﻿
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace WPFByCoreApp
{
    /// <summary>
    /// 全局数据定义
    /// </summary>
    public class CommonData
    {
        /// <summary>
        /// 是否打开了文件对话框
        /// </summary>
        public static bool IsOpenFileDialog = false;
        /// <summary>
        /// 当前路径
        /// </summary>
        public static string CurrentDirectory = System.IO.Directory.GetCurrentDirectory();
        /// <summary>
        /// 配置文件路径
        /// </summary>
        public static string ConfigFilePath = CurrentDirectory + "\\Config\\Config.xml";
        /// <summary>
        /// dump文件
        /// </summary>
        public static string DumpPath = CurrentDirectory + "\\Dump";
        /// <summary>
        /// 语言文件路径
        /// </summary>
        public static string ShowLanguageFilePath = CurrentDirectory + "\\Config\\Culture.dat";
        /// <summary>
        /// 中频带宽文件路径
        /// </summary>
        public static string IFBWFilePath = CurrentDirectory + "\\Config\\IFBW.xml";
        /// <summary>
        /// 插件文件路径
        /// </summary>
        public static string PluginFilePath = CurrentDirectory + "\\Plugin";
        /// <summary>
        /// 日志文件路径
        /// </summary>
        public static string LogFilePath = CurrentDirectory + "\\Log";
        /// <summary>
        /// 读版本信息
        /// </summary>
        public static string ReadConfigPathExe = CurrentDirectory + "\\Network Analyzer.exe";
        /// <summary>
        /// 中英文转换存储数据
        /// </summary>
        public static Hashtable EnglishOrChineseHashtable = null;
        public static object MainWindow = null;
        /// <summary>
        /// 连接IP
        /// </summary>
        public static string IP = "127.0.0.1";
        /// <summary>
        /// 连接端口
        /// </summary>
        public static ushort Port = 60180;

        /// <summary>
        /// 绘图默认字体
        /// </summary>
        public static string FontName = "宋体";
        /// <summary>
        /// 字体大小
        /// </summary>
        public static float FontSize = 13;
        /// <summary>
        /// 是否写迹线数据日志
        /// </summary>
        public static bool IsWriteTraceDataLog = false;
        /// <summary>
        /// 是否写正常操作日志
        /// </summary>
        public static bool IsWriteNormalLog = true;
        /// <summary>
        /// 是否load提示
        /// </summary>
        public static bool IsLoaderTips = false;
        /// <summary>
        /// 是否获取数据异常
        /// </summary>
        public static bool IsGetServerDataCatch = false;
        /// <summary>
        /// 当前扫描通道
        /// </summary>
        public static uint CurrentSweepChannelIndex = 0;
        /// <summary>
        /// UI日志得数量
        /// </summary>
        public static int DailyFileNum = 60;
        /// <summary>
        /// 右边转载控件名字
        /// </summary>
        public static string RightModeBaseControl = "RightModeBaseControl";
        /// <summary>
        /// 右边转载控件名字
        /// </summary>
        public const string ChannelStatusControl = "ChannelStatusControl";
        /// <summary>
        /// 主状态栏控件名字
        /// </summary>
        public const string MainStatusControl = "MainStatusControl";
        /// <summary>
        /// 主菜单测量
        /// </summary>
        public const string MainMenuMeasuement = "MainMenuMeasuement";
        /// <summary>
        ///  夹具仿真菜单种测量
        /// </summary>
        public const string FixtureSimulatorMeasuement = "FixtureSimulatorMeasuement";
        public const string ITest = "iTest";
        /// <summary>
        /// 异常日志不写日志时间
        /// </summary>
        public const int ErrorLogMaxMinutes = 5;
        public const int ErrorLogMaxDataNum = 3000;
        /// <summary>
        /// 左下显示控件高度
        /// </summary>
        public static int LeftDownFormControlHeight = 250;
        /// <summary>
        /// 右边模块，上下箭头按钮高度
        /// </summary>
        public const int RightTriangleButtonHeight = 25;
        /// <summary>
        /// 界面显示的最大点数
        /// </summary>
        public const int UIMaxPoints = 20000000;
        /// <summary>
        /// 是否打开数据输入框
        /// </summary>
        public static bool IsOpenDataInputControl = false;
        /// <summary>
        /// 输入框最大长度
        /// </summary>
        public static int TbxInputMaxLength = 30;
        /// <summary>
        /// 右边软键盘宽度
        /// </summary>
        public static int VisualKeysGridWidth = 600;
        /// <summary>
        /// 是否打开右边菜单栏
        /// </summary>
        public static bool IsOpenRightModeBaseControl = true;
        /// <summary>
        /// 输入框最大输入长度
        /// </summary>
        public const int DataInputMaxLength = 20;
        /// <summary>
        /// 是否记录scpi执行时间
        /// </summary>
        public static bool isWriteScpiTime = false;
        /// <summary>
        /// 当前语言状态1:英语；2：中文
        /// </summary>
        public static int LanguageStatus = 1;
        /// <summary>
        /// 是否重新设置了通道迹线配置
        /// </summary>
        public static bool isChangeChannelAndTracesSet = false;
        /// <summary>
        /// 主窗体状态
        /// </summary>
        public static WindowState MainWindowState = WindowState.Maximized;
        /// <summary>
        /// 是否处理主窗体事件
        /// </summary>
        public static bool isDealMainWindowInformation = true;
        /// <summary>
        /// 是否最大化显示当前通道的当前迹线
        /// </summary>
        public static bool isBigShowCurrentChannelTrace = true;
        /// <summary>
        /// 是否可以推荐校准
        /// </summary>
        public static bool isOptionalCalibrate = false;
        /// <summary>
        /// 日志最大行数
        /// </summary>
        public const decimal MaxLoggerRowData = 31143;

        /// <summary>
        /// 显示的字体大小
        /// </summary>
        public static int ShowFontSize = 12;
        /// <summary>
        /// 按钮高度
        /// </summary>
        public static int ShowButtonHeight = 42;
        /// <summary>
        /// 最大通道数
        /// </summary>
        public static int MaxChannelCount = 42;
        /// <summary>
        /// 最大通道数临时
        /// </summary>
        public static int MaxChannelCountTmp = 42;
        /// <summary>
        /// 右边控件宽度
        /// </summary>
        public static int RightPanlWidth = 158;
        /// <summary>
        /// 图边框宽
        /// </summary>
        public static int PicEdgeWidth = 5;
        /// <summary>
        /// 图状态栏高度
        /// </summary>
        public static int PicStatusHeight = 22;
        /// <summary>
        /// 状态栏边框
        /// </summary>
        public static int PicStatusEdgeWidth = 2;
        /// <summary>
        /// 是否正在关闭窗体
        /// </summary>
        public static bool IsCloseWindows = false;
        /// <summary>
        /// 是否正常显示窗体
        /// </summary>
        public static bool IsNormalShowForm = true;
        /// <summary>
        /// 是否0号子仪器登录
        /// </summary>
        public static bool IsZeroSubInstrInto = true;
        /// <summary>
        /// 是否存在子仪器
        /// </summary>
        public static bool IsExistSubInstr = true;

        /// <summary>
        /// 是否仪器服务异常
        /// </summary>
        public static bool IsServerError = false;

        /// <summary>
        /// 当前扫描端口号
        /// </summary>
        public static int CurrentSweepPortIndex = 0;
        /// <summary>
        /// 当前端口数
        /// </summary>
        public static int CurrentPortNumber = 4;
        /// <summary>
        /// 端口延伸点击所有端口
        /// </summary>
      //  public static bool AutoPortExtensionsClickAllPort = false;
        /// <summary>
        /// 当前仪器通道数
        /// </summary>
        public static int CurrentChannelNumber = 0;
        /// <summary>
        /// 当前仪器最大点数
        /// </summary>
        public static int ServiceChannelPointCount = 1601;
        /// <summary>
        /// 子仪器号
        /// </summary>
        public static int SubInstrNumber = 1;
        /// <summary>
        /// 端口匹配当前索引(暂时UI存）
        /// </summary>
        public static int PortMatchingPortIndex = 1;
        /// <summary>
        /// 是否上推迹线数据
        /// </summary>
        public static bool IsDisplayEnable = true;
        /// <summary>
        /// 处理线程睡眠时间
        /// </summary>
        public static int MessageQueuesSleepTime = 2;
        /// <summary>
        /// 判断鼠标是否上滚
        /// </summary>
        public static bool IsMouseUpRightControl = false;
        /// <summary>
        /// 子仪器License
        /// </summary>
        public static Dictionary<string, int> SubInstrLicenses = new Dictionary<string, int>();
        public static bool isAddMessageQueues = false;
        public static ConcurrentDictionary<string, KeyValuePair<string, object>> MessageQueues =
            new ConcurrentDictionary<string, KeyValuePair<string, object>>();
        //public static List<List<int>> MessageQueuesProgress = new List<List<int>>();
        public static ConcurrentDictionary<int, List<int>> MessageQueuesProgress =
            new ConcurrentDictionary<int, List<int>>();
        public static ConcurrentDictionary<string, KeyValuePair<string, object>> InsideMessageQueues =
            new ConcurrentDictionary<string, KeyValuePair<string, object>>();

        public static bool isOnPreSetEventStart = false;
        public static bool isNewPresetWait = false;


        public static string None = "None";
        public const string BgrSvrMain = "BgrSvrMain";

        public const string TailStr = "\n";
        public const string ScpiSplitStr = ";";
        /// <summary>
        /// 执行异常
        /// </summary>
        public const string ExecuteError = "Execute error";
        public const string NoError = "NO ERROR";
        /// <summary>
        /// 最大时间
        /// </summary>
        public const float MaxTimeData = 345320000000000000f;
        /// <summary>
        /// 光速
        /// </summary>
        public const float LightSpeed = 299792458f;
        /// <summary>
        /// 是否是本地服务IP
        /// </summary>
        public static bool IsLocalServerIP = true;
        /// <summary>
        /// 相减的差值
        /// </summary>
        public static float DifferenceValue = 0.0000001f;
        /// <summary>
        /// 左下角提示的当前状态
        /// </summary>
        public static bool MainStatusControlPromptIsNull = true;
        /// <summary>
        /// 下方列表数据状态
        /// </summary>
        public static string LeftDownGridDataStatus = "";
        /// <summary>
        /// 未定义得头提示
        /// </summary>
        public const string UndefinedHeader = "Undefined header";
        /// <summary>
        /// 主窗体位置
        /// </summary>
        public static Rect MainWindowRct = new Rect();
        ///// <summary>
        ///// 按照最大通道200申请
        ///// </summary>
        //public static ChannelDrawingData[] channelDrawingDatas = new ChannelDrawingData[200];

        /// <summary>
        /// 仪器支持的最大通道数
        /// </summary>
        public const int RealMaxChannel = 200;
        /// <summary>
        /// 整个通道的布局
        /// </summary>
        public static string WholeLayout = "D1";
        /// <summary>
        /// 整个通道的布局(绘图)
        /// </summary>
        public static string WholeDrawLayout = "D1";
        /// <summary>
        /// 是否前面板和键盘锁定
        /// </summary>
        public static bool isFrontPanelKeyboardLock = false;
        /// <summary>
        /// 是否触摸屏和鼠标锁定
        /// </summary>
        public static bool isTouchScreenMouseLock = false;
        /// <summary>
        /// 是否模拟键盘按钮
        /// </summary>
        public static bool isSimulationSetKeyBoard = false;
        /// <summary>
        /// 设置iolib.dll等待时间
        /// </summary>
        public const int SetLifeTimeNormal = 10;
        /// <summary>
        /// 设置iolib.dll最长等待时间
        /// </summary>
        public const int SetLifeTimeMax = 600;
        /// 时域转换最小值比较
        /// </summary>
        public const float TransformSmallBalue = 1f / UnitE;

        /// <summary>
        /// S1P
        /// </summary>
        public const string S1P = "S1P";
        /// <summary>
        /// S2P
        /// </summary>
        public const string S2P = "S2P";
        /// <summary>
        /// S3P
        /// </summary>
        public const string S3P = "S3P";
        /// <summary>
        /// S4P
        /// </summary>
        public const string S4P = "S4P";
        /// <summary>
        /// Fwd
        /// </summary>
        public const string Fwd = "Fwd";
        /// <summary>
        /// Rvs
        /// </summary>
        public const string Rvs = "Rvs";
        /// <summary>
        /// 功率单位
        /// </summary>
        public const string dBm = "dBm";
        /// <summary>
        /// dB/GHz
        /// </summary>
        public const string dBGHz = "dB/GHz";
        /// <summary>
        /// Hz
        /// </summary>
        public const string Hz = "Hz";
        /// <summary>
        /// dB
        /// </summary>
        public const string dB = "dB";
        /// <summary>
        /// 欧姆
        /// </summary>
        public const string OHM = "Ω";
        /// <summary>
        /// 单位S
        /// </summary>
        public const string S = "S";
        /// <summary>
        /// 单位E
        /// </summary>
        public const string E = "E";
        /// <summary>
        /// 单位P
        /// </summary>
        public const string P = "P";
        /// <summary>
        /// 单位T
        /// </summary>
        public const string T = "T";
        /// <summary>
        /// 单位G
        /// </summary>
        public const string G = "G";
        /// <summary>
        /// 单位M
        /// </summary>
        public const string M = "M";
        /// <summary>
        /// 单位k
        /// </summary>
        public const string k = "k";
        /// <summary>
        /// 单位m
        /// </summary>
        public const string m = "m";
        /// <summary>
        /// 单位u
        /// </summary>
        public const string u = "u";
        /// <summary>
        /// 单位n
        /// </summary>
        public const string n = "n";
        /// <summary>
        /// 单位p
        /// </summary>
        public const string p = "p";
        /// <summary>
        /// 单位f
        /// </summary>
        public const string f = "f";
        /// <summary>
        /// 单位a
        /// </summary>
        public const string a = "a";
        /// <summary>
        /// 单位H
        /// </summary>
        public const string H = "H";
        /// <summary>
        /// 单位F
        /// </summary>
        public const string F = "F";
        /// <summary>
        /// 单位秒
        /// </summary>
        public const string s = "s";
        #region 单位相关
        public const float Unitk = (float)1E+3;
        public const float UnitM = (float)1E+6;
        public const float UnitG = (float)1E+9;
        public const float UnitT = (float)1E+12;
        public const float UnitP = (float)1E+15;
        public const float UnitE = (float)1E+18;
        public const float UnitZ = (float)1E+21;
        public const float UnitY = (float)1E+24;
        #endregion

        #region   日志相关
        /// <summary>
        /// 操作日志序号
        /// </summary>
        public const int OperateLoggerIndex = 1;
        /// <summary>
        /// 操作日志序号
        /// </summary>
        public const int EventLoggerIndex = 2;
        /// <summary>
        /// 异常日志序号
        /// </summary>
        public const int ErrorLoggerIndex = 3;
        #endregion

        #region   保存状态相关
        /// <summary>
        /// 保存对话框默认路径
        /// </summary>
        public static string SaveFilePath = "C:\\";
        /// <summary>
        /// 保存状态名
        /// </summary>
        public static string SaveStateName = "State";

        #endregion

        #region   marker相关
        /// <summary>
        /// 目前标记数
        /// </summary>
        public static int CurrentMarkerNum = 15;

        /// <summary>
        /// 图形上显示marker符号位数
        /// </summary>
        public static int MarkerShowDigit = 9;
        /// <summary>
        /// 图形上显示marker保留的小数点后位数
        /// </summary>
        public static int MarkerRetentionNumber = 7;
        /// <summary>
        /// 图形上显示标记搜索带宽和陷波符号位数
        /// </summary>
        public static int MarkerSearchShowDigit = 11;
        /// <summary>
        /// 图形上显示标记搜索带宽和陷波保留的小数点后位数
        /// </summary>
        public static int MarkerSearchRetentionNumber = 9;
        /// <summary>
        /// 图形上显示标记功能-统计位数
        /// </summary>
        public const int MarkerFunctionShowDigit = 6;
        /// <summary>
        /// 图形上显示标记输入框-位数
        /// </summary>
        public static int MarkerDataInputShowDigit = 11;
        /// <summary>
        /// 图形上显示标记功能-统计保留的小数点后位数
        /// </summary>
        public static int MarkerFunctionRetentionNumber = 4;
        /// <summary>
        /// 目标范围数
        /// </summary>
        public const int TargetRangeNo = 16;
        /// <summary>
        /// 是否打开标记表
        /// </summary>
        public static bool IsOpenMarkerTable = false;

        /// <summary>
        /// 在功率扫描时x轴为dBm ,显示的数字位数
        /// </summary>
        public static int PowerSweepXShowDigit = 9;
        #endregion

        #region   当前通道相关
        /// <summary>
        /// 是否设置输入框的焦点
        /// </summary>
        public static bool IsSetSetFocus = false;
        /// <summary>
        /// 当前通道
        /// </summary>
        public static int CurrentChannelNum = 1;
        /// <summary>
        /// 当前的迹线号
        /// </summary>
        public static int CurrentTraceNum = 1;
        /// <summary>
        /// 每个通道下边的迹线数
        /// </summary>
        public static int TracesNum = 16;
        /// <summary>
        /// 目前的端口数
        /// </summary>
        public static int CurrentPortNum = 4;
        /// <summary>
        /// 开始频率
        /// </summary>
        public static float StartFreq = 300000;
        /// <summary>
        /// 结束频率
        /// </summary>
        public static float StopFreq = 8500000000;

        /// <summary>
        /// 精度数据G到A
        /// </summary>
        public static float AccuracyData = UnitE;
        /// <summary>
        /// log比例数据
        /// </summary>
        public static double[] VerticalScaleData = new double[8];
        /// <summary>
        /// 最大点数
        /// </summary>
        public static int Points = 100001;
        /// <summary>
        /// 主界面数据输入框高度
        /// </summary>
        public static int DataInputControlHeight = 35;
        /// <summary>
        /// 刷新图形屏幕时间
        /// </summary>
        public const int RefreshScreenTime = 20;
        /// <summary>
        /// 刷新时间差
        /// </summary>
        public static int TimeDifferenceTime = 0;
        /// <summary>
        /// 是否停止更新数据
        /// </summary>
        public static bool IsStopUpdateData = false;
        /// <summary>
        /// 复位得到新的迹线绘图位置
        /// </summary>
        public const string PicShowDataGetPosition = "100";
        /// <summary>
        /// 极大值标记
        /// </summary>
        public const string BigValueMark = "500";

        /// <summary>
        /// 是否获取到了上推数据
        /// </summary>
        public static bool isGetUpdateData = false;
        /// <summary>
        /// 界面是否显示频率
        /// </summary>
        public static bool IsOpenFrequency = true;
        /// <summary>
        /// 绘图是否完成
        /// </summary>
        public static bool isUpdatePicOver = true;
        /// <summary>
        /// 目前的显示名
        /// </summary>
        public static int CurrentShowName = 0;

        //public static List<object> TracesControls;
        /// <summary>
        /// 当前通道分段数据
        /// </summary>
       // public static string CurrentChannelSegmentData;
        /// <summary>
        /// 当前通道极限测试数据
        /// </summary>
        public static string CurrentChannelLimitTestData;
        /// <summary>
        /// 当前通道纹波极限测试数据
        /// </summary>
        public static string CurrentChannelRippleLimitTestData;
        /// <summary>
        /// 当前通道点极限测试数据
        /// </summary>
        public static string CurrentChannelPointLimitTestData;
        ///// <summary>
        ///// 当前通道端口延伸端口状态
        ///// </summary>
        //public static AutoPortExtensionsPortStatus[] CurrentAutoPortExtensionsPortStatusData = null;
        /// <summary>
        /// 分段扫描数据
        /// </summary>
        public static object SweepSetupSegmentList = null;
        /// <summary>
        /// 段表头最大索引
        /// </summary>
        public const int SegmentTableStartIndex = 7;
        /// <summary>
        /// 段数据切分数据字符
        /// </summary>
        public const char SegmentTableSplitString = ',';
        /// <summary>
        /// 分段扫描是否要刷新数据
        /// </summary>
        public static bool SegmentRefreshData = false;
        /// <summary>
        /// 是否更新界面显示数据
        /// </summary>
        public static bool IsUpdateShowData = false;
        /// <summary>
        /// 是否初始化完成
        /// </summary>
        public static bool IsInitDataOver = false;
        /// <summary>
        /// 是否移动更新
        /// </summary>
        public static bool IsMouseMoveUpdateMarker = false;

        public static bool isCurrentDraw = false;
        /// <summary>
        /// 保存状态自动索引
        /// </summary>
        public const int SaveStateAutorecIndex = 10001;
        /// <summary>
        /// 保存状态用户预知索引
        /// </summary>
        public const int SaveStateUserPresIndex = 10002;
        /// <summary>
        /// 史密斯圆点数
        /// </summary>
        public const int SimthCirclePoints = 100;
        /// <summary>
        /// 列表最大长度
        /// </summary>
        public const int SegSegmentMaxLength = 201;
        /// <summary>
        /// 错误的marker索引
        /// </summary>
        public const int ErrorMarkIndex = 1001;
        /// <summary>
        /// 是否绘图控件大小发生改变
        /// </summary>
        public static bool IsDrawControlSizeChanged = true;
        /// <summary>
        /// 最大化当前通道
        /// </summary>
        public static bool isChannelMax = false;

        #endregion


        #region 相关测试
        /// <summary>
        /// 是否显示不合格标识
        /// </summary>
        public static bool isFailSign = false;
        /// <summary>
        /// 测试不通过小点宽度
        /// </summary>
        public static int TestPointWidth = 4;
        /// <summary>
        /// 测试不通过小点颜色
        /// </summary>
        public static float[] gLTrianglecolors = new float[12];
        /// <summary>
        /// 纹波测试最大条数
        /// </summary>
        public const int RippleHandCount = 12;
        #endregion



        #region 绘图相关
        /// <summary>
        /// 参考阻抗(暂时定为50，后面用scpi取)
        /// </summary>
        public const float RefImpedanceZ0 = 50f;
        /// <summary>
        /// 绘图边距
        /// </summary>
        public const float PicMargin = 20;
        /// <summary>
        /// x轴暂时定10等分切分
        /// </summary>
        public const int PicDxDivisionValue = 10;
        /// <summary>
        /// x轴小步进
        /// </summary>
        public const int PicDxSmallDivisionValue = 50;
        /// <summary>
        /// 参考位置三角行宽
        /// </summary>
        public const float PicTriangleWidth = 8;
        /// <summary>
        /// 图形控件左边字体长度 CommonFunction.MeasureTextWidth("000000", 12) + triangleWidth;
        /// </summary>
        public static float PicLeftFontLen = 60;
        /// <summary>
        /// 迹线头高
        /// </summary>
        public static float PicTraceHeadHeight = 15;
        /// <summary>
        /// 向后台发送命令间隔毫秒数
        /// </summary>
        public static int SpanMilliseconds = 50;
        /// <summary>
        /// 对数对应步进
        /// </summary>
        public static decimal[] LogStepDataKeys = new decimal[]
        { 1/ (decimal)500,1/ (decimal)200,1/ (decimal)100,
            1/ (decimal)50,1/ (decimal)20,1/ (decimal)10,
             1/ (decimal)5,1/ (decimal)2,1,
             1 * 1, 1 * 2, 1 * 5,
             1 * 10, 1 * 20, 1 * 50,
             1 * 100, 1 * 200, 1 * 500,
             1 * 1000, 1 * 2000, 1 * 5000};

        public static float[] LogStepDataValues = new float[]
       { (float)(500 * (decimal)UnitM),(float)(200 * (decimal)UnitM),(float)(100 * (decimal)UnitM),
            (float)(50 * (decimal)UnitM),(float)(20 * (decimal)UnitM),(float)(10 * (decimal)UnitM),
             (float)(5 * (decimal)UnitM),(float)(2 * (decimal)UnitM),(float)(1 * (decimal)UnitM),
             (float)((decimal)UnitM / 1) ,(float)((decimal)UnitM / 2) ,(float)((decimal)UnitM / 5),
             (float)((decimal)UnitM / 10) ,(float)((decimal)UnitM / 20) ,(float)((decimal)UnitM / 50) ,
             (float)((decimal)UnitM / 100) ,(float)((decimal)UnitM / 200) ,(float)((decimal)UnitM / 500) ,
            (float)((decimal)UnitM / 1000) ,(float)((decimal)UnitM / 2000) ,(float)((decimal)UnitM / 5000) };
        #endregion

        #region   弹出窗体事件定义
        /// <summary>
        /// 不合格标志开关
        /// </summary>
        public const string FailSignWindow = "FailSignWindow";
        /// <summary>
        /// 不合格标志清理
        /// </summary>
        public const string FailSignWindowClear = "FailSignWindowClear";
        #endregion

        #region   消息事件定义
        /// <summary>
        /// 初始化窗口是否受到预制事件
        /// </summary>
        public const string IsPreSetSelectWindows = "IsPreSetSelectWindows";
        /// <summary>
        /// 子仪器菜单是佛否显示
        /// </summary>
        public const string SystemSubInstrumentMenuShowOrHide = "SystemSubInstrumentMenuShowOrHide";
        /// <summary>
        /// 电子校准键进度
        /// </summary>
        public const string SystemMeasuringWindowStep = "SystemMeasuringWindowStep";
        /// <summary>
        /// 电子校准键进度条关闭
        /// </summary>
        public const string SystemMeasuringWindowClose = "SystemMeasuringWindowClose";
        /// <summary>
        /// 控件到显示区域
        /// </summary>
        public const string ControlToScrollViewerVisible = "ControlToScrollViewerVisible";
        /// <summary>
        /// 系统时间被更改
        /// </summary>
        public const string SystemTimeChanged = "SystemTimeChanged";
        /// <summary>
        /// 前面板和键盘是否被禁用
        /// </summary>
        public const string FrontPanelKeyboardLock = "FrontPanelKeyboardLock";
        /// <summary>
        /// 触摸屏和鼠标是否被禁用
        /// </summary>
        public const string TouchScreenMouseLock = "TouchScreenMouseLock";
        /// <summary>
        /// 重新计算当前软件位置
        /// </summary>
        public const string MainWindowRctPos = "MainWindowRctPos";
        /// <summary>
        /// 更新about License信息
        /// </summary>
        public const string UpdateAboutLicensesInformation = "UpdateAboutLicensesInformation";
        /// <summary>
        /// 更新License信息
        /// </summary>
        public const string UpdateLicensesInformation = "UpdateLicensesInformation";
        /// <summary>
        /// 关闭当前软件
        /// </summary>
        public const string CloseMainWindow = "CloseMainWindow";
        /// <summary>
        /// 窗体右边控件宽度发生改变
        /// </summary>
        public const string WindowRightPanelWidthChange = "WindowRightPanelWidthChange";
        /// <summary>
        /// 更新调整大小菜单状态EnglishOrChinese
        /// </summary>
        public const string UpdateMainWindowResizeMenuState = "UpdateMainWindowResizeMenuState";
        /// <summary>
        /// 中英文改变
        /// </summary>
        public const string EnglishOrChineseChange = "EnglishOrChineseChange";
        /// <summary>
        /// 设置主窗体状态
        /// </summary>
        public const string SetMainWindowStatus = "SetMainWindowStatus";
        /// <summary>
        /// 设置当前通道最大化
        /// </summary>
        public const string CurrentChannelMax = "CurrentChannelMax";
        /// <summary>
        /// 当前迹线发生改变
        /// </summary>
        public const string TraceActiveShowData = "TraceActiveShowData";
        /// <summary>
        /// 当前marker发生改变
        /// </summary>
        public const string MarkerActiveShowData = "MarkerActiveShowData";
        /// <summary>
        /// 当前marker显示位置发生改变
        /// </summary>
        public const string MarkerPositionXYChange = "MarkerPositionXYChange";
        /// <summary>
        /// 当前通道发生改变
        /// </summary>
        public const string ChannelActiveShowData = "ChannelActiveShowData";
        /// <summary>
        /// 当前通道标题发生改变
        /// </summary>
        public const string ChannelTitleLabelShowOrHide = "ChannelTitleLabelShowOrHide";

        /// <summary>
        /// 清空主窗体dataInputGrid
        /// </summary>
        public const string MainFormDataInputGridClear = "MainFormDataInputGridClear";
        /// <summary>
        /// 右边菜单头是否焦点
        /// </summary>
        public const string RightMainMenuHeadIntoOrLoseFocus = "RightMainMenuHeadIntoOrLoseFocus";
        /// <summary>
        /// 输入框是否焦点
        /// </summary>
        public const string DataInputControlIntoOrLoseFocus = "DataInputControlIntoOrLoseFocus";
        /// <summary>
        /// 左下列表是否焦点
        /// </summary>
        public const string LeftDownGridControlIntoOrLoseFocus = "LeftDownGridControlIntoOrLoseFocus";
        /// <summary>
        /// 上传图形显示数据
        /// </summary>
        public const string UpdatePicShowData = "UpdatePicShowData";
        /// <summary>
        /// 刷新标记表数据
        /// </summary>
        public const string AddChannelMarkerTableData = "AddChannelMarkerTableData";
        /// <summary>
        /// 初始化图形
        /// </summary>
        public const string InitPicShowData = "InitPicShowData";
        /// <summary>
        /// 初始图形控件背景颜色
        /// </summary>
        public const string InitPicBackColor = "InitPicBackColor";
        /// <summary>
        /// 最大化或者正常显示迹线
        /// </summary>
        public const string MaxOrNormalPicShowData = "MaxOrNormalPicShowData";
        /// <summary>
        /// 初始化迹线显示数据
        /// </summary>
        public const string InitTraceShowData = "InitTraceShowData";
        /// <summary>
        /// 更新标记列表背景色
        /// </summary>
        public const string UpdateMarkerTableBackground = "UpdateMarkerTableBackground";
        /// <summary>
        /// 初始化marker显示数据
        /// </summary>
        public const string InitMarkerShowData = "InitMarkerShowData";
        /// <summary>
        /// 初始化通道显示数据
        /// </summary>
        public const string InitChannelShowData = "InitChannelShowData";
        /// <summary>
        /// 更新图形上显示的通道状态数据
        /// </summary>
        public const string UpdateChannelChannelStatusShow = "UpdateChannelChannelStatusShow";
        /// <summary>
        /// 系统校准开关刷新通道属性
        /// </summary>
        public const string SystemCorrectionStateChangeProperty = "SystemCorrectionStateChangeProperty";
        /// <summary>
        /// 更新指定图形的数据
        /// </summary>
        public const string UpdateDesignatedShowData = "UpdateDesignatedShowData";
        /// <summary>
        /// 清除当前的迹线显示数据
        /// </summary>
        public const string ClearCurrentTraceShowData = "ClearCurrentTraceShowData";
        /// <summary>
        /// 底层上传显示数据
        /// </summary>
        public const string SinkUpLoadShowData = "SinkUpLoadShowData";
        /// <summary>
        /// 底层上传显示平均数据
        /// </summary>
        public const string SinkUpAverageCountShowData = "SinkUpAverageCountShowData";
        /// <summary>
        /// 底层上传分配通道显示数据
        /// </summary>
        public const string SinkUpLoadAllocChannelShowData = "SinkUpLoadAllocChannelShowData";
        /// <summary>
        /// 更新测量显示数据
        /// </summary>
        public const string SinkUpLoadMeasuementShowData = "SinkUpLoadMeasuementShowData";
        /// <summary>
        /// 更新迹线选择按钮
        /// </summary>
        public const string SinkUpLoadNDisplayumOfTracesShowData = "SinkUpLoadNDisplayumOfTracesShowData";
        /// <summary>
        /// 校准回传数据
        /// </summary>
        public const string SinkUpLoadCalibrateShowData = "SinkUpLoadCalibrateShowData";
        /// <summary>
        /// 显示 数据回传数据
        /// </summary>
        public const string SinkUpLoadDisplayDataShowData = "SinkUpLoadDisplayDataShowData";
        /// <summary>
        /// 更新界面显示
        /// </summary>
        public const string SinkUpUpdateFormShowData = "SinkUpUpdateFormShowData";
        /// <summary>
        /// 加载显示通道
        /// </summary>
        public const string AddShowChannelFormData = "AddShowChannelFormData";
        /// <summary>
        /// 设置焦点控件操作：1：left;3:right;2:up;4:down;5:Enter
        /// </summary>
        public const string ControlFocusStatus = "ControlFocusStatus";
        /// <summary>
        /// 设置右边控件状态
        /// </summary>
        public const string BaseControlControlFocusStatus = "BaseControlControlFocusStatus";
        /// <summary>
        /// 设置虚拟键打开关闭
        /// </summary>
        public const string VisualKeysOpenClose = "VisualKeysOpenClose";
        /// <summary>
        /// 启动界面显示后台启动进度
        /// </summary>
        public const string BgrStartupStateValue = "BgrStartupStateValue";
        /// <summary>
        /// 子仪器分配发生改变
        /// </summary>
        public const string AllocInstrumentShowData = "AllocInstrumentShowData";
        /// <summary>
        /// 关闭子仪器窗体
        /// </summary>
        public const string CloseSubInstrWindow = "CloseSubInstrWindow";
        /// <summary>
        /// 关闭当前软件
        /// </summary>
        public const string UpdateRevolveUpDownControl = "UpdateRevolveUpDownControl";
        /// <summary>
        /// 按照上传时间返回的路径截图
        /// </summary>
        public const string OnDumpScreenImageChangedEvent = "OnDumpScreenImageChangedEvent";
        /// <summary>
        /// TDR相关时间设置
        /// </summary>
        public const string TDRModifyTime = "TDRModifyTime";
        #region   左侧图形消息事件定义
        /// <summary>
        /// 图形上中英文切换
        /// </summary>
        public const string LeftPictureUpShowData = "LeftPictureUpShowData";
        /// <summary>
        /// 更新界面显示数据
        /// </summary>
        public const string UpdateWindowFormShowData = "UpdateWindowFormShowData";
        /// <summary>
        /// 设置状态栏平均触发显示宽度
        /// </summary>
        public const string UpdateChannelStatus = "UpdateChannelStatus";
        /// <summary>
        /// 设置状态栏显示开始结束还是中心跨距
        /// </summary>
        public const string UpdateChannelStartOrCenterStatus = "UpdateChannelStartOrCenterStatus";
        /// <summary>
        /// 左侧下边显示框
        /// </summary>
        public const string LeftDownFormControl = "LeftDownFormControl";
        /// <summary>
        /// 左侧下边显示框初始化数据
        /// </summary>
        public const string InitDataLeftDownFormControl = "InitDataLeftDownFormControl";
        /// <summary>
        /// 左侧下边显示框更新数据
        /// </summary>
        public const string UpdateDataLeftDownFormControl = "UpdateDataLeftDownFormControl";
        #endregion

        #region   右侧主菜单消息事件定义
        /// <summary>
        /// 右侧主菜单单击激励按钮
        /// </summary>
        public const string RightMainMenuClickStimulus = "RightMainMenuClickStimulus";
        /// <summary>
        /// 右侧主菜单单击激励平均
        /// </summary>
        public const string RightMainMenuClickAveraging = "RightMainMenuClickAveraging";
        /// <summary>
        /// 右侧主菜单单击显示平均
        /// </summary>
        public const string RightMainMenuClickDisplay = "RightMainMenuClickDisplay";
        /// <summary>
        /// 右侧主菜单单击格式
        /// </summary>
        public const string RightMainMenuClickScale = "RightMainMenuClickScale";
        /// <summary>
        /// 右侧主菜单单击格式-电延迟
        /// </summary>
        public const string RightScaleClickElectricalDelay = "RightScaleClickElectricalDelay";
        /// <summary>
        /// 右侧主菜单单击测量
        /// </summary>
        public const string RightMainMenuClickMeasuement = "RightMainMenuClickMeasuement";
        /// <summary>
        /// 右侧主菜单单击格式
        /// </summary>
        public const string RightMainMenuClickFormat = "RightMainMenuClickFormat";
        /// <summary>
        /// 右侧主菜单单击校准
        /// </summary>
        public const string RightMainMenuClickCalibrate = "RightMainMenuClickCalibrate";
        /// <summary>
        /// 右侧主菜单单击扫描设置
        /// </summary>
        public const string RightMainMenuClickSweepSetup = "RightMainMenuClickSweepSetup";
        /// <summary>
        /// 右侧主菜单单击标记
        /// </summary>
        public const string RightMainMenuClickMarker = "RightMainMenuClickMarker";
        /// <summary>
        /// 右侧主菜单单击触发
        /// </summary>
        public const string RightMainMenuClickTrigger = "RightMainMenuClickTrigger";
        /// <summary>
        /// 右侧主菜单单击保存/调用
        /// </summary>
        public const string RightMainMenuClickSaveRecall = "RightMainMenuClickSaveRecall";
        /// <summary>
        /// 右侧主菜单单击复位
        /// </summary>
        public const string RightMainMenuClickPreset = "RightMainMenuClickPreset";
        /// <summary>
        /// 右侧主菜单单击插件
        /// </summary>
        public const string RightMainMenuClickPlugin = "RightMainMenuClickPlugin";
        /// <summary>
        /// 右侧主菜单单击标记搜索
        /// </summary>
        public const string RightMainMenuClickMarkerSearch = "RightMainMenuClickMarkerSearch";
        /// <summary>
        /// 右侧主菜单单击标记功能 
        /// </summary>
        public const string RightMainMenuClickMarkerFunction = "RightMainMenuClickMarkerFunction";
        /// <summary>
        /// 右侧主菜单单击分析功能 
        /// </summary>
        public const string RightMainMenuClickAnalysisFunction = "RightMainMenuClickAnalysisFunction";
        /// <summary>
        /// 右侧主菜单单击系统功能 
        /// </summary>
        public const string RightMainMenuClickSystemFunction = "RightMainMenuClickSystemFunction";
        #endregion

        #region   右侧测量消息事件定义
        /// <summary>
        /// 右侧测量单击绝对值
        /// </summary>
        public const string RightMeasuementClickAbsolute = "RightMeasuementClickAbsolute";
        /// <summary>
        /// 右侧测量单击比值
        /// </summary>
        public const string RightMeasuementClickRatio = "RightMeasuementClickRatio";
        /// <summary>
        /// 右侧测量-比值-单击激励端口
        /// </summary>
        public const string RightRatioClickStimulusPort = "RightRatioClickStimulusPort";
        /// <summary>
        /// 右侧测量-比值-单击源端口
        /// </summary>
        public const string RightRatioClickSourcePort = "RightRatioClickSourcePort";
        #endregion

        #region   右侧标记消息事件定义
        /// <summary>
        /// 右侧标记单击清除标记
        /// </summary>
        public const string RightMarkerClickClearMarker = "RightMarkerClickClearMarker";
        /// <summary>
        /// 右侧标记单击更多标记
        /// </summary>
        public const string RightMarkerClickMoreMarker = "RightMarkerClickMoreMarker";
        /// <summary>
        /// 右侧标记更新
        /// </summary>
        public const string RightMarkerMenuUpdateSelect = "RightMarkerMenuUpdateSelect";
        /// <summary>
        /// 右侧更多标记更新
        /// </summary>
        public const string RightMarkerMoreMarkerMenuUpdateSelect = "RightMarkerMoreMarkerMenuUpdateSelect";
        #endregion

        #region   右侧平均消息事件定义
        /// <summary>
        /// 右侧平均单击中频带宽按钮
        /// </summary>
        public const string RightAveragingMenuClickIFBW = "RightAveragingMenuClickIFBW";
        /// <summary>
        /// 右侧平均单击平均因数
        /// </summary>
        public const string RightAveragingMenuClickAverFactor = "RightAveragingMenuClickAverFactor";
        /// <summary>
        /// 右侧平均单击平滑孔径
        /// </summary>
        public const string RightAveragingMenuClicSmoAperture = "RightAveragingMenuClicSmoAperture";
        #endregion

        #region   右侧格式消息事件定义
        /// <summary>
        /// 右侧格式更新
        /// </summary>
        public const string RightFormatMenuUpdateSelect = "RightFormatMenuUpdateSelect";

        #endregion

        #region   右侧触发消息事件定义
        /// <summary>
        /// 右侧触发单击触发源
        /// </summary>
        public const string RightTriggerClickTriggerSource = "RightTriggerClickTriggerSource";
        #endregion

        #region   右侧刻度消息事件定义
        /// <summary>
        /// 右侧刻度菜单点击分度
        /// </summary>
        public const string RightScaleMenuClickDivisions = "RightScaleMenuClickDivisions";
        /// <summary>
        /// 右侧刻度菜单点击刻度/分度
        /// </summary>
        public const string RightScaleMenuClickDivisionsDiv = "RightScaleMenuClickDivisionsDiv";
        /// <summary>
        /// 右侧刻度菜单点击参考位置
        /// </summary>
        public const string RightScaleMenuClickReferencePosition = "RightScaleMenuClickReferencePosition";
        /// <summary>
        /// 右侧刻度菜单点击参考值
        /// </summary>
        public const string RightScaleMenuClickReferenceValue = "RightScaleMenuClickReferenceValue";
        /// <summary>
        /// 右侧刻度菜单点击相位偏移
        /// </summary>
        public const string RightScaleMenuClickPhaseOffset = "RightScaleMenuClickPhaseOffset";
        /// <summary>
        /// 右侧刻度菜单点击电延迟
        /// </summary>
        public const string RightScaleMenuClickElectricalDelay = "RightScaleMenuClickElectricalDelay";
        #endregion

        #region   右侧校准消息事件定义
        /// <summary>
        /// 右侧校准菜单点击校准
        /// </summary>
        public const string RightCalibrateMenuClickCalibrate = "RightCalibrateMenuClickCalibrate";
        /// <summary>
        /// 右侧校准校准菜单点击2端口校准
        /// </summary>
        public const string RightCalibrateCalibrateMenuClickTwoPortCal = "RightCalibrateCalibrateMenuClickTwoPortCal";
        /// <summary>
        /// 右侧校准校准菜单点击3端口校准
        /// </summary>
        public const string RightCalibrateCalibrateMenuClickThreePortCal = "RightCalibrateCalibrateMenuClickThreePortCal";
        /// <summary>
        /// 右侧校准校准菜单点击1端口校准
        /// </summary>
        public const string RightCalibrateCalibrateMenuClickOnePortCal = "RightCalibrateCalibrateMenuClickOnePortCal";
        /// <summary>
        /// 右侧校准校准菜单点击响应(直通)校准
        /// </summary>
        public const string RightCalibrateCalibrateClickResponseThruCal = "RightCalibrateCalibrateClickResponseThruCal";
        /// <summary>
        /// 右侧校准校准菜单点击增强响应校准
        /// </summary>
        public const string RightCalibrateCalibrateClickEnhancedResponseCal = "RightCalibrateCalibrateClickEnhancedResponseCal";
        /// <summary>
        /// 右侧校准校准菜单点击响应应(开路)校准
        /// </summary>
        public const string RightCalibrateCalibrateClickResponseOpenCal = "RightCalibrateCalibrateClickResponseOpenCal";
        /// <summary>
        /// 右侧校准校准菜单点击响应(短路)校准
        /// </summary>
        public const string RightCalibrateCalibrateClickResponseShortCal = "RightCalibrateCalibrateClickResponseShortCal";
        /// <summary>
        /// 右侧校准校准菜单-响应(开路)校准点击选择端口
        /// </summary>
        public const string CalibrateResponseOpenClickSelectPort = "CalibrateResponseOpenClickSelectPort";
        /// <summary>
        /// 右侧校准校准菜单-响应(直通)点击选择端口
        /// </summary>
        public const string RightResponseThruClickSelectPorts = "RightResponseThruClickSelectPorts";
        /// <summary>
        /// 右侧校准校准菜单-增强响应点击选择端口
        /// </summary>
        public const string EnhancedResponseThruClickSelectPorts = "EnhancedResponseThruClickSelectPorts";
        /// <summary>
        /// 右侧校准校准菜单点击2端口TRL校准
        /// </summary>
        public const string RightCalibrateCalibrateClickTwoTRLCal = "RightCalibrateCalibrateClickTwoTRLCal";
        /// <summary>
        /// 右侧校准校准菜单点击3端口TRL校准
        /// </summary>
        public const string RightCalibrateCalibrateClickThreeTRLCal = "RightCalibrateCalibrateClickThreeTRLCal";
        /// <summary>
        /// 右侧校准校准菜单点击4端口TRL校准
        /// </summary>
        public const string RightCalibrateCalibrateClickFourTRLCal = "RightCalibrateCalibrateClickFourTRLCal";
        /// <summary>
        /// 右侧校准校准菜单-2端口TRL校准点击选择端口
        /// </summary>
        public const string TwoTRLCalClickSelectPorts = "TwoTRLCalClickSelectPorts";
        /// <summary>
        /// 右侧校准校准菜单-2端口TRL校准点击直通/传输线
        /// </summary>
        public const string TwoTRLCalClickThruLine = "TwoTRLCalClickThruLine";
        /// <summary>
        /// 右侧校准校准菜单-2端口TRL校准点击反射
        /// </summary>
        public const string TwoTRLCalClickReflect = "TwoTRLCalClickReflect";
        /// <summary>
        /// 右侧校准校准菜单-2端口TRL校准点击传输线/匹配
        /// </summary>
        public const string TwoTRLCalClickLineMatch = "TwoTRLCalClickLineMatch";
        /// <summary>
        /// 右侧校准校准菜单-3端口TRL校准点击传输线/匹配
        /// </summary>
        public const string ThreeTRLCalClickLineMatch = "ThreeTRLCalClickLineMatch";
        /// <summary>
        /// 右侧校准校准菜单-3端口TRL校准点击选择端口
        /// </summary>
        public const string ThreeTRLCalClickSelectPorts = "ThreeTRLCalClickSelectPorts";
        /// <summary>
        /// 右侧校准校准菜单-3端口TRL校准点击直通/传输线
        /// </summary>
        public const string ThreeTRLCalClickThruLine = "ThreeTRLCalClickThruLine";
        /// <summary>
        /// 右侧校准校准菜单-4端口TRL校准点击直通/传输线
        /// </summary>
        public const string FourTRLCalClickThruLine = "FourTRLCalClickThruLine";
        /// <summary>
        /// 右侧校准校准菜单-3端口TRL校准点击反射
        /// </summary>
        public const string ThreeTRLCalClickReflect = "ThreeTRLCalClickReflect";
        /// <summary>
        /// 右侧校准校准菜单-4端口TRL校准点击反射
        /// </summary>
        public const string FourTRLCalClickReflect = "FourTRLCalClickReflect";
        /// <summary>
        /// 右侧校准校准菜单-4端口TRL校准点击传输线/匹配
        /// </summary>
        public const string FourTRLCalClickLineMatch = "FourTRLCalClickLineMatch";
        /// <summary>
        /// 右侧校准校准1端口校准菜单点击选择端口
        /// </summary>
        public const string RightCalibrateCalibrateOnePortCalMenuClickSelectPort =
            "RightCalibrateCalibrateOnePortCalMenuClickSelectPort";
        /// <summary>
        /// 右侧校准选择校准端口
        /// </summary>
        public const string RightCalibrateSelectTypePort =
            "RightCalibrateSelectTypePort";
        /// <summary>
        /// 右侧校准校准2端口校准菜单点击选择端口
        /// </summary>
        public const string RightCalibrateCalibrateTwoPortCalMenuClickSelectPort =
            "RightCalibrateCalibrateTwoPortCalMenuClickSelectPort";
        /// <summary>
        /// 右侧校准校准2端口校准菜单点击反射
        /// </summary>
        public const string RightCalibrateCalibrateTwoPortCalMenuClickReflection =
            "RightCalibrateCalibrateTwoPortCalMenuClickReflection";
        /// <summary>
        /// 右侧校准校准2端口校准菜单点击传输
        /// </summary>
        public const string RightCalibrateCalibrateTwoPortCalMenuClickTransmission =
            "RightCalibrateCalibrateTwoPortCalMenuClickTransmission";
        /// <summary>
        /// 右侧校准校准2端口校准菜单点击是否隔离
        /// </summary>
        public const string RightCalibrateCalibrateTwoPortCalMenuClickIsolation =
            "RightCalibrateCalibrateTwoPortCalMenuClickIsolation";
        /// <summary>
        /// 右侧校准校准2端口校准菜单点击是否取消
        /// </summary>
        public const string RightCalibrateCalibrateTwoPortCalMenuClickCancel =
            "RightCalibrateCalibrateTwoPortCalMenuClickCancel";
        /// <summary>
        /// 右侧校准校准3端口校准菜单点击选择端口
        /// </summary>
        public const string RightCalibrateCalibrateThreePortCalMenuClickSelectPort =
            "RightCalibrateCalibrateThreePortCalMenuClickSelectPort";
        /// <summary>
        /// 右侧校准校准3端口校准菜单点击反射
        /// </summary>
        public const string RightCalibrateCalibrateThreePortCalMenuClickReflection =
            "RightCalibrateCalibrateThreePortCalMenuClickReflection";
        /// <summary>
        /// 右侧校准校准3端口校准菜单点击传输
        /// </summary>
        public const string RightCalibrateCalibrateThreePortCalMenuClickTransmission =
            "RightCalibrateCalibrateThreePortCalMenuClickTransmission";
        /// <summary>
        /// 右侧校准校准3端口校准菜单点击是否隔离
        /// </summary>
        public const string RightCalibrateCalibrateThreePortCalMenuClickIsolation =
            "RightCalibrateCalibrateThreePortCalMenuClickIsolation";
        /// <summary>
        /// 右侧校准校准菜单点击4端口校准
        /// </summary>
        public const string RightCalibrateCalibrateMenuClickFourPortCal = "RightCalibrateCalibrateMenuClickFourPortCal";
        /// <summary>
        /// 右侧校准校准4端口校准菜单点击反射
        /// </summary>
        public const string RightCalibrateCalibrateFourPortCalMenuClickReflection =
            "RightCalibrateCalibrateFourPortCalMenuClickReflection";
        /// <summary>
        /// 右侧校准校准4端口校准菜单点击传输
        /// </summary>
        public const string RightCalibrateCalibrateFourPortCalMenuClickTransmission =
            "RightCalibrateCalibrateFourPortCalMenuClickTransmission";
        /// <summary>
        /// 右侧校准校准4端口校准菜单点击是否隔离
        /// </summary>
        public const string RightCalibrateCalibrateFourPortCalMenuClickIsolation =
            "RightCalibrateCalibrateFourPortCalMenuClickIsolation";
        /// <summary>
        /// 右侧校准菜单点击校准套件
        /// </summary>
        public const string RightCalibrateMenuClickCalKit = "RightCalibrateMenuClickCalKit";
        /// <summary>
        /// 校准套件回传数据
        /// </summary>
        public const string SinkUpCalibrateMenuClickCalKitShowData = "SinkUpCalibrateMenuClickCalKitShowData";

        /// <summary>
        /// 右侧校准菜单点击修改校准件
        /// </summary>
        public const string CalibrateClickModifyCalKit = "CalibrateClickModifyCalKit";
        /// <summary>
        /// 右侧校准菜单-修改校准件点击定义标准
        /// </summary>
        public const string ModifyCalKitClickDefineStds = "ModifyCalKitClickDefineStds";
        /// <summary>
        /// 右侧校准菜单-修改校准件点击定义CLS
        /// </summary>
        public const string ModifyCalKitClickDefineCLS = "ModifyCalKitClickDefineCLS";
        /// <summary>
        /// 右侧校准菜单-修改校准件-CLS点击定义子类
        /// </summary>
        public const string ModifyCalKitCLSClickDefineSubClass = "ModifyCalKitCLSClickDefineSubClass";
        /// <summary>
        /// 右侧校准菜单-修改校准件-CLS点击TRL直通
        /// </summary>
        public const string ModifyCalKitCLSClickTRLThru = "ModifyCalKitCLSClickTRLThru";
        /// <summary>
        /// 右侧校准菜单-修改校准件-CLS点击open,short,load
        /// </summary>
        public const string ModifyCalKitCLSClickBaseType = "ModifyCalKitCLSClickBaseType";
        /// <summary>
        /// 右侧校准菜单-修改校准件点击TRL选项
        /// </summary>
        public const string ModifyCalKitClickTRLLine = "ModifyCalKitClickTRLLine";
        /// <summary>
        /// 右侧校准菜单-修改校准件-定义标准点击类型
        /// </summary>
        public const string ModifyCalKitClickDefineStdsType = "ModifyCalKitClickDefineStdsType";
        /// <summary>
        /// 右侧校准菜单-修改校准件-定义标准-类型点击STD type
        /// </summary>
        public const string ModifyCalKitClickDefineStdsTypeStd = "ModifyCalKitClickDefineStdsTypeStd";
        /// <summary>
        /// 右侧校准菜单-修改校准件-定义标准-类型点击定义类型
        /// </summary>
        public const string ModifyCalKitClickDefineButton = "ModifyCalKitClickDefineButton";
        /// <summary>
        /// 校准更新属性
        /// </summary>
        public const string CalPropertyFromByte = "CalPropertyFromByte";
        /// <summary>
        /// 右侧校准菜单点击端口延伸
        /// </summary>
        public const string RightCalibrateMenuClickPortExtensions = "RightCalibrateMenuClickPortExtensions";
        /// <summary>
        /// 右侧端口延伸点击自动端口延伸
        /// </summary>
        public const string RightPortExtensionsClickAuto = "RightPortExtensionsClickAuto";
        /// <summary>
        /// 右侧自动端口延伸点击选择端口
        /// </summary>
        public const string RightAutoPortExtensionsClickSelectPorts = "RightAutoPortExtensionsClickSelectPorts";
        /// <summary>
        /// 右侧自动端口延伸点击测量开路
        /// </summary>
        public const string RightAutoPortExtensionsClickMeasureOpen = "RightAutoPortExtensionsClickMeasureOpen";
        /// <summary>
        /// 右侧自动端口延伸点击测量短路
        /// </summary>
        public const string RightAutoPortExtensionsClickMeasureShort = "RightAutoPortExtensionsClickMeasureShort";
        /// <summary>
        /// 右侧自动端口延伸点击方法选择
        /// </summary>
        public const string RightAutoPortExtensionsClickMethod = "RightAutoPortExtensionsClickMethod";
        /// <summary>
        /// 右侧端口延伸点击延伸端口
        /// </summary>
        public const string RightPortExtensionsClickExtensionsPort = "RightPortExtensionsClickExtensionsPort";
        /// <summary>
        /// 右侧延伸端口点击损耗
        /// </summary>
        public const string RightExtensionsPortClickLoss = "RightExtensionsPortClickLoss";
        /// <summary>
        /// 右侧延伸端口点击同轴延伸值
        /// </summary>
        public const string RightExtensionsPortClickCoaxExtensions = "RightExtensionsPortClickCoaxExtensions";
        /// <summary>
        /// 右侧延伸端口点击设置波导值
        /// </summary>
        public const string RightExtensionsPortClickWaveguide = "RightExtensionsPortClickWaveguide";
        /// <summary>
        /// 右侧延伸端口点击截止频率值
        /// </summary>
        public const string RightExtensionsPortClickCutoffFrequecy = "RightExtensionsPortClickCutoffFrequecy";
        /// <summary>
        /// 右侧延伸端口损耗点击损耗值
        /// </summary>
        public const string RightExtensionsPortLossClickLoss = "RightExtensionsPortLossClickLoss";
        /// <summary>
        /// 右侧延伸端口损耗点击频率
        /// </summary>
        public const string RightExtensionsPortLossClickFrequency = "RightExtensionsPortLossClickFrequency";
        /// <summary>
        /// 右侧延伸端口损耗点击直流端口损耗
        /// </summary>
        public const string RightExtensionsPortLossClickLossAtDC = "RightExtensionsPortLossClickLossAtDC";
        /// <summary>
        /// 右侧自动端口延伸方法点击用户指定跨距
        /// </summary>
        public const string RightAutoPortExtensionsMethodClickUserSpan = "RightAutoPortExtensionsMethodClickUserSpan";

        /// <summary>
        /// 右侧校准菜单电子校准键
        /// </summary>
        public const string CalibrateECal = "CalibrateECal";
        /// <summary>
        /// 右侧校准菜单点击电子校准键
        /// </summary>
        public const string CalibrateClickECal = "CalibrateClickECal";
        /// <summary>
        /// 右侧校准电子校准键菜单点击一端口校准
        /// </summary>
        public const string CalibrateECalClickOnePort = "CalibrateECalClickOnePort";
        /// <summary>
        /// 右侧校准电子校准键菜单点击二端口校准
        /// </summary>
        public const string CalibrateECalClickTwoPort = "CalibrateECalClickTwoPort";
        /// <summary>
        /// 右侧校准电子校准键菜单点击三端口校准
        /// </summary>
        public const string CalibrateECalClickThreePort = "CalibrateECalClickThreePort";
        /// <summary>
        /// 右侧校准电子校准键菜单点击直通校准
        /// </summary>
        public const string CalibrateECalClickThruCal = "CalibrateECalClickThruCal";
        /// <summary>
        /// 右侧校准电子校准键菜单点击特性
        /// </summary>
        public const string CalibrateECalClickCharacterization = "CalibrateECalClickCharacterization";
        /// <summary>
        /// 右侧校准电子校准键菜单点击特性信息
        /// </summary>
        public const string CalibrateECalClickCharacterizationInfo = "CalibrateECalClickCharacterizationInfo";
        /// <summary>
        /// 右侧校准电子校准键菜单点击方向
        /// </summary>
        public const string CalibrateECalClickOrientation = "CalibrateECalClickOrientation";
        /// <summary>
        /// 右侧校准电子校准键菜单点电子校准
        /// </summary>
        public const string CalibrateECalClickECal = "CalibrateECalClickECal";
        /// <summary>
        /// 右侧校准电子校准校准单击端口
        /// </summary>
        public const string CalibrateECalECalClickPort = "CalibrateECalECalClickPort";

        /// <summary>
        /// 设置Z0参数
        /// </summary>
        public const string CalibrateSetZ0 = "CalibrateSetZ0";
        /// <summary>
        /// 设置速度因子参数
        /// </summary>
        public const string CalibrateSetVelocityFactor = "CalibrateSetVelocityFactor";

        /// <summary>
        /// 设置Z0参数软件盘单位事件
        /// </summary>
        public const string CalibrateSetZ0KeyboardUnitEvnet = "CalibrateSetZ0KeyboardUnitEvnet";
        /// <summary>
        /// 右侧校准菜单点编辑校准件名称
        /// </summary>
        public const string RightCalibrateClickCalibrateLable = "RightCalibrateClickCalibrateLable";
        /// <summary>
        /// 右侧校准菜单点编辑Std名称
        /// </summary>
        public const string RightCalibrateClickStdLable = "RightCalibrateClickStdLable";
        #endregion

        #region   右侧激励消息事件定义
        /// <summary>
        /// 右侧激励模拟点击按钮按钮
        /// </summary>
        public const string RightMainMenuClickStimulusType = "RightMainMenuClickStimulusType";
        /// <summary>
        /// 右侧激励单击最小频率按钮
        /// </summary>
        public const string RightStimulusMenuClickStart = "RightStimulusMenuClickStart";
        /// <summary>
        /// 右侧激励单击最大频率按钮
        /// </summary>
        public const string RightStimulusMenuClickStop = "RightStimulusMenuClickStop";
        /// <summary>
        /// 右侧激励单击中心频率按钮
        /// </summary>
        public const string RightStimulusMenuClickCenter = "RightStimulusMenuClickCenter";
        /// <summary>
        /// 右侧激励单击频率跨距按钮
        /// </summary>
        public const string RightStimulusMenuClickSpan = "RightStimulusMenuClickSpan";
        /// <summary>
        /// 右侧激励单击返回按钮
        /// </summary>
        public const string RightStimulusMenuClickReturn = "RightStimulusMenuClickReturn";
        /// <summary>
        /// PreSet事件处理
        /// </summary>
        public const string PreSetEventDeal = "PreSetEventDeal";
        /// <summary>
        /// OnSystemErrorCodePushEvent
        /// </summary>
        public const string OnSystemErrorCodeDeal = "OnSystemErrorCodeDeal";
        /// <summary>
        /// OnConversionFuncChangeEvent
        /// </summary>
        public const string OnConversionFuncChangeDeal = "OnConversionFuncChangeDeal";
        /// <summary>
        /// InitTraceShowDataDeal
        /// </summary>
        public const string InitTraceShowDataDeal = "InitTraceShowDataDeal";
        /// <summary>
        /// UpdateSweepChannelData
        /// </summary>
        public const string UpdateSweepChannelData = "UpdateSweepChannelData";
        /// <summary>
        /// OnSegmentSweepDataChangedEvent
        /// </summary>
        public const string OnSegmentSweepDataChangedDeal = "OnSegmentSweepDataChangedDeal";

        #region 右侧显示 返回显示界面
        /// <summary>
        /// 右侧显示 分配迹线单击取消按钮
        /// </summary>
        public const string RightDisplaySonClickReturn = "RightDisplaySonClickReturn";
        #endregion

        #endregion

        #region   右侧显示消息事件定义
        ///// <summary>
        ///// 右侧主菜单显示
        ///// </summary>
        //public const string RightMainMenuDisplay = "RightMainMenuDisplay";
        /// <summary>
        /// 右侧显示单击分配通道按钮
        /// </summary>
        public const string RightDisplayMenuClickAllocateChannels = "RightDisplayMenuClickAllocateChannels";
        /// <summary>
        /// 右侧显示单击分配迹线按钮
        /// </summary>
        public const string RightDisplayMenuClickAllocateTraces = "RightDisplayMenuClickAllocateTraces";
        /// <summary>
        /// 右侧显示单击分数据
        /// </summary>
        public const string RightDisplayMenuClickData = "RightDisplayMenuClickData";
        /// <summary>
        /// 右侧显示单击迹线数按钮
        /// </summary>
        public const string RightDisplayMenuClickNumOfTraces = "RightDisplayMenuClickNumOfTraces";
        /// <summary>
        /// 右侧显示分配迹线 选择迹线样式按钮
        /// </summary>
        public const string RightDisplayAllocateTracesClickSelectTraces = "RightDisplayAllocateTracesClickSelectTraces";
        /// <summary>
        /// 右侧显示单击分数据计算
        /// </summary>
        public const string RightDisplayMenuClickDataMath = "RightDisplayMenuClickDataMath";
        /// <summary>
        /// 右侧显示单击分数据保持
        /// </summary>
        public const string RightDisplayMenuClickDataHold = "RightDisplayMenuClickDataHold";
        /// <summary>
        /// 右侧刻度菜单点击分度
        /// </summary>
        public const string RightDisplayMenuClickEditTitleLable = "RightDisplayMenuClickEditTitleLable";
        #endregion

        #region   右侧扫描设置消息事件定义
        /// <summary>
        /// 右侧扫描设置单击功率按钮
        /// </summary>
        public const string RightSweepSetupMenuClickPower = "RightSweepSetupMenuClickPower";
        /// <summary>
        /// 右侧扫描设置 -功率单击端口功率按钮
        /// </summary>
        public const string RightSweepSetupPowerClickPortPower = "RightSweepSetupPowerClickPortPower";
        /// <summary>
        /// 右侧扫描设置功率单击功率按钮
        /// </summary>
        public const string RightSweepSetupPowerMenuClickPower = "RightSweepSetupPowerMenuClickPower";
        /// <summary>
        /// 右侧扫描设置功率单击斜率按钮
        /// </summary>
        public const string RightSweepSetupPowerMenuClickSlope = "RightSweepSetupPowerMenuClickSlope";
        /// <summary>
        /// 右侧扫描设置功率单击固定频率按钮
        /// </summary>
        public const string RightSweepSetupPowerMenuClickCWFreq = "RightSweepSetupPowerMenuClickCWFreq";
        /// <summary>
        /// 右侧扫描设置单击扫描类型按钮
        /// </summary>
        public const string RightSweepSetupMenuClickSweepType = "RightSweepSetupMenuClickSweepType";
        /// <summary>
        /// 右侧扫描设置单击扫描时间按钮
        /// </summary>
        public const string RightSweepSetupMenuClickSweepTime = "RightSweepSetupMenuClickSweepTime";
        /// <summary>
        /// 右侧扫描设置单击扫描延时按钮
        /// </summary>
        public const string RightSweepSetupMenuClickSweepDelay = "RightSweepSetupMenuClickSweepDelay";
        /// <summary>
        /// 右侧扫描设置单击扫描点数按钮SweepSetupSegmentList
        /// </summary>
        public const string RightSweepSetupMenuClickSweepPoints = "RightSweepSetupMenuClickSweepPoints";
        /// <summary>
        /// 右侧扫描设置单击编辑分段按钮
        /// </summary>
        public const string RightSweepSetupMenuClickEditSegment = "RightSweepSetupMenuClickEditSegment";
        /// <summary>
        /// 右侧分段单击返回按钮
        /// </summary>
        public const string RightSweepSetupEditSegmentMenuClickReturn = "RightSweepSetupEditSegmentMenuClickReturn";
        /// <summary>
        /// 右侧分段列表上下按钮返回DataGrid操作对应数据
        /// </summary>
        public const string RightSweepSetupEditSegmentMenuComboBox = "RightSweepSetupEditSegmentMenuComboBox";
        /// <summary>
        /// 设置DataGrid单元格焦点
        /// </summary>
        public const string SetLeftDownDataGridCellComboBoxFocus = "SetLeftDownDataGridCellComboBoxFocus";
        /// <summary>
        /// 右侧分段列表键盘返回DataGrid操作对应数据
        /// </summary>
        public const string RightSweepSetupEditSegmentMenuComboBoxKey = "RightSweepSetupEditSegmentMenuComboBoxKey";
        /// <summary>
        /// 右侧分段列表键盘返回DataGrid操作对应数据Unloaded
        /// </summary>
        public const string RightSweepSetupEditSegmentMenuComboBoxKeyUnloaded = "RightSweepSetupEditSegmentMenuComboBoxKeyUnloaded";
        /// <summary>
        /// 右侧新增一行命令
        /// </summary>
        public const string RightSweepSetupEditSegmentMenuAddNewRow = "RightSweepSetupEditSegmentMenuAddNewRow";
        /// <summary>
        /// 改变Delete按钮状态
        /// </summary>
        public const string RightSweepSetupEditSegmentListToRight = "RightSweepSetupEditSegmentListToRight";
        /// <summary>
        ///Delete按钮删除命令
        /// </summary>
        public const string RightSweepSetupEditSegmentDeleteRightToList = "RightSweepSetupEditSegmentDeleteRightToList";
        /// <summary>
        ///初始化分段扫描列表数据
        /// </summary>
        public const string RightSweepSetupEditSegmentInitListControlData = "RightSweepSetupEditSegmentInitListControlData";
        /// <summary>
        ///清理分段扫描数据
        /// </summary>
        public const string RightSweepSetupEditSegmentClearIniControlData = "RightSweepSetupEditSegmentClearIniControlData";
        /// <summary>
        ///更新分段扫描类型选择
        /// </summary>
        public const string RightSweepSetupUpdateSweepTypeSelect = "RightSweepSetupUpdateSweepTypeSelect";
        /// <summary>
        /// 右侧分段列表键盘返回ComboBox得到焦点点击进入编辑
        /// </summary>
        public const string RightSweepSetupEditSegmentMenuComboBoxKeyGotFocus = "RightSweepSetupEditSegmentMenuComboBoxKeyGotFocus";
        #endregion

        #region   右侧保存调用消息事件定义
        /// <summary>
        /// 底层上传格式修改显示数据
        /// </summary>
        public const string SinkUpLoadSnpFormatShowData = "SinkUpLoadSnpFormatShowData";
        /// <summary>
        /// 右侧保存/调用单击 保存snp
        /// </summary>
        public const string RightSaveRecallClickSaveSnp = "RightSaveRecallClickSaveSnp";
        /// <summary>
        /// 右侧保存snp单击 snp格式
        /// </summary>
        public const string RightSaveSnpClickSnpFormat = "RightSaveSnpClickSnpFormat";
        /// <summary>
        /// 右侧保存snp单击 s1p格式
        /// </summary>
        public const string RightSaveSnpClickSnpS1P = "RightSaveSnpClickSnpS1P";
        /// <summary>
        /// 右侧保存snp单击 s2p格式
        /// </summary>
        public const string RightSaveSnpClickSnpS2P = "RightSaveSnpClickSnpS2P";
        /// <summary>
        /// 右侧保存snp单击 s3p格式
        /// </summary>
        public const string RightSaveSnpClickSnpS3P = "RightSaveSnpClickSnpS3P";
        /// <summary>
        /// 右侧保存snp单击 s4p格式
        /// </summary>
        public const string RightSaveSnpClickSnpS4P = "RightSaveSnpClickSnpS4P";
        /// <summary>
        /// 右侧保存/调用单击 保存状态
        /// </summary>
        public const string RightSaveRecallClickSaveState = "RightSaveRecallClickSaveState";
        /// <summary>
        /// 右侧保存/调用单击 调用状态
        /// </summary>
        public const string RightSaveRecallClickRecallState = "RightSaveRecallClickRecallState";
        /// <summary>
        /// 右侧保存/调用单击 保存通道状态
        /// </summary>
        public const string RightSaveRecallClickSaveChannel = "RightSaveRecallClickSaveChannel";
        /// <summary>
        /// 右侧保存通道状态单击清理状态
        /// </summary>
        public const string RightSaveChannelClickClearStates = "RightSaveChannelClickClearStates";
        /// <summary>
        /// 右侧保存/调用单击 调用通道状态
        /// </summary>
        public const string RightSaveRecallClickRecallChannel = "RightSaveRecallClickRecallChannel";
        /// <summary>
        /// 右侧保存/调用单击 保存类型
        /// </summary>
        public const string RightSaveRecallClickSaveType = "RightSaveRecallClickSaveType";
        #endregion

        #region   标记消息事件定义
        /// <summary>
        ///marker频率修改
        /// </summary>
        public const string RightMarkerMarkerFreq = "RightMarkerMarkerFreq";
        /// <summary>
        ///设置图形上选择marker
        /// </summary>
        public const string RightMarkerSetPicSelectMarker = "RightMarkerSetPicSelectMarker";
        #endregion

        #region   触发消息事件定义
        /// <summary>
        /// 右侧触发单击触发延时按钮
        /// </summary>
        public const string RightTriggerMenuClickTriggerDelay = "RightTriggerMenuClickTriggerDelay";
        #endregion

        #region   系统消息事件定义
        /// <summary>
        /// 右侧系统单击其他设置按钮
        /// </summary>
        public const string RightSystemClickMiscSetup = "RightSystemClickMiscSetup";
        /// <summary>
        /// 右侧系统-其他设置-通道迹线设置单击按钮
        /// </summary>
        public const string RightSystemMiscSetupClickChannelTraceSetup = "RightSystemMiscSetupClickChannelTraceSetup";
        /// <summary>
        /// 右侧系统-其他设置-显示设置单击按钮
        /// </summary>
        public const string RightSystemMiscSetupClickDisplaySetup = "RightSystemMiscSetupClickDisplaySetup";
        /// <summary>
        /// 右侧系统-其他设置-蜂鸣器单击按钮
        /// </summary>
        public const string RightSystemMiscSetupClickBeeper = "RightSystemMiscSetupClickBeeper";
        /// <summary>
        /// 右侧系统-其他设置-键盘值锁定单击按钮
        /// </summary>
        public const string RightSystemMiscSetupClickKeyLock = "RightSystemMiscSetupClickKeyLock";
        /// <summary>
        /// 右侧系统-其他设置-显示设置-放大倍数单击按钮
        /// </summary>
        public const string RightSystemDisplaySetupClickMagnification = "RightSystemDisplaySetupClickMagnification";
        /// <summary>
        /// 右侧系统单击服务按钮
        /// </summary>
        public const string RightSystemClickServiceMenu = "RightSystemClickServiceMenu";
        /// <summary>
        /// 右侧系统-其他设置-参考时钟
        /// </summary>
        public const string RightSystemMiscSetupClickRefSource = "RightSystemMiscSetupClickRefSource";
        /// <summary>
        /// 右侧系统-其他设置-预制设置
        /// </summary>
        public const string RightSystemMiscSetupClickPresetSetup = "RightSystemMiscSetupClickPresetSetup";
        /// <summary>
        /// 右侧系统-保存屏幕图像
        /// </summary>
        public const string RightSystemMiscSetupClickDumpScreenImage = "RightSystemMiscSetupClickDumpScreenImage";
        /// <summary>
        /// 右侧系统-其他设置-预制设置-状态
        /// </summary>
        public const string RightSystemMiscPresetSetupClickStatus = "RightSystemMiscPresetSetupClickStatus";
        /// <summary>
        /// messageBox消息处理
        /// </summary>
        public const string VNAMessageBoxInformationDeal = "VNAMessageBoxInformationDeal";


        /// <summary>
        /// 右侧系统-其他设置-时钟设置
        /// </summary>
        public const string RightSystemMiscSetupClickLockSet = "RightSystemMiscSetupClickLockSet";
        #endregion

        #region   分析消息事件定义
        /// <summary>
        /// 右侧分析-极限线偏移单击整幅偏移按钮
        /// </summary>
        public const string RighLimitLineOffsetsMenuClickAmplitudeOffset = "RighLimitLineOffsetsMenuClickAmplitudeOffset";
        /// <summary>
        /// 右侧分析-极限线偏移单击激励偏移按钮
        /// </summary>
        public const string RighLimitLineOffsetsMenuClickStimulusOffset = "RighLimitLineOffsetsMenuClickStimulusOffset";
        /// <summary>
        /// 右侧极限测试列表上下按钮返回DataGrid操作对应数据
        /// </summary>
        public const string RightLimitTestEditSegmentMenuComboBox = "RightLimitTestEditSegmentMenuComboBox";
        /// <summary>
        /// 右侧极限测试列表键盘返回DataGrid操作对应数据
        /// </summary>
        public const string RightLimitTestEditSegmentMenuComboBoxKey = "RightLimitTestEditSegmentMenuComboBoxKey";
        /// <summary>
        /// 右侧极限测试列表键盘返回DataGrid操作对应数据Unloaded
        /// </summary>
        public const string RightLimitTestEditSegmentMenuComboBoxKeyUnloaded = "RightLimitTestEditSegmentMenuComboBoxKeyUnloaded";
        /// <summary>
        /// 右侧极限测试列表更新
        /// </summary>
        public const string RightLimitTestUpdateEditSegmentData = "RightLimitTestUpdateEditSegmentData";
        /// <summary>
        /// 右侧极限测试列表更新(图形下方)
        /// </summary>
        public const string RightLimitTestUpdateEditSegmentDataList = "RightLimitTestUpdateEditSegmentDataList";
        /// <summary>
        ///清理极限测试扫描数据
        /// </summary>
        public const string RightLimitTestEditSegmentClearIniControlData = "RightSweepSetupEditSegmentClearIniControlData";
        /// <summary>
        /// 右侧纹波极限测试列表上下按钮返回DataGrid操作对应数据
        /// </summary>
        public const string RightRippleLimitTestEditSegmentMenuComboBox = "RightRippleLimitTestEditSegmentMenuComboBox";
        /// <summary>
        /// 右侧纹波极限测试列表键盘返回DataGrid操作对应数据
        /// </summary>
        public const string RightRippleLimitTestEditSegmentMenuComboBoxKey = "RightRippleLimitTestEditSegmentMenuComboBoxKey";
        /// <summary>
        /// 右侧纹波极限测试列表键盘返回DataGrid操作对应数据Unloaded
        /// </summary>
        public const string RightRippleLimitTestEditSegmentMenuComboBoxKeyUnloaded = "RightRippleLimitTestEditSegmentMenuComboBoxKeyUnloaded";
        /// <summary>
        /// 右侧纹波极限测试列表更新
        /// </summary>
        public const string RightRippleLimitTestUpdateEditSegmentData = "RightRippleLimitTestUpdateEditSegmentData";
        /// <summary>
        /// 右侧纹波极限测试列表更新(图形下方)
        /// </summary>
        public const string RightRippleLimitTestUpdateEditSegmentDataList = "RightRippleLimitTestUpdateEditSegmentDataList";
        /// <summary>
        ///清理纹波极限测试扫描数据
        /// </summary>
        public const string RightRippleLimitTestEditSegmentClearIniControlData = "RightRippleLimitTestEditSegmentClearIniControlData";

        /// <summary>
        /// 右侧点极限测试列表上下按钮返回DataGrid操作对应数据
        /// </summary>
        public const string RightPointLimitTestEditSegmentMenuComboBox = "RightPointLimitTestEditSegmentMenuComboBox";
        /// <summary>
        /// 右侧点极限测试列表键盘返回DataGrid操作对应数据
        /// </summary>
        public const string RightPointLimitTestEditSegmentMenuComboBoxKey = "RightPointLimitTestEditSegmentMenuComboBoxKey";
        /// <summary>
        /// 右侧点极限测试列表键盘返回DataGrid操作对应数据Unloaded
        /// </summary>
        public const string RightPointLimitTestEditSegmentMenuComboBoxKeyUnloaded = "RightPointLimitTestEditSegmentMenuComboBoxKeyUnloaded";
        /// <summary>
        /// 右侧点极限测试列表更新
        /// </summary>
        public const string RightPointLimitTestUpdateEditSegmentData = "RightPointLimitTestUpdateEditSegmentData";
        /// <summary>
        /// 右侧点极限测试列表更新(图形下方)
        /// </summary>
        public const string RightPointLimitTestUpdateEditSegmentDataList = "RightPointLimitTestUpdateEditSegmentDataList";
        /// <summary>
        ///清理点极限测试扫描数据
        /// </summary>
        public const string RightPointLimitTestEditSegmentClearIniControlData = "RightPointLimitTestEditSegmentClearIniControlData";
        /// <summary>
        /// 右侧分析-夹具仿真器-端口Z转换实部
        /// </summary>
        public const string RightFixturePortZConversionClickReal = "RightFixturePortZConversionClickReal";
        /// <summary>
        /// 右侧分析-夹具仿真器-端口Z转换虚部
        /// </summary>
        public const string RightFixturePortZConversionClickImag = "RightFixturePortZConversionClickImag";
        /// <summary>
        /// 右侧分析-夹具仿真器-去嵌入端口选择
        /// </summary>
        public const string RightFixtureMenuClickSelectPort = "RightFixtureMenuClickSelectPort";
        /// <summary>
        /// 右侧分析-夹具仿真器-去嵌入端口选择
        /// </summary>
        public const string RightFixtureMenuClickSelectType = "RightFixtureMenuClickSelectType";

        #endregion

        #region   标记搜索消息事件定义
        /// <summary>
        ///标记搜索 峰值
        /// </summary>
        public const string RightMarkerMarkerSearchPeak = "RightMarkerMarkerSearchPeak";
        /// <summary>
        ///标记搜索 峰值极性
        /// </summary>
        public const string RightMarkerMarkerSearchPeakPolarity = "RightMarkerMarkerSearchPeakPolarity";
        /// <summary>
        ///标记搜索 多峰值
        /// </summary>
        public const string RightMarkerMarkerSearchMultiPeak = "RightMarkerMarkerSearchMultiPeak";
        /// <summary>
        /// 右侧峰值点击峰值漂移值
        /// </summary>
        public const string RightMarkerSearchMenuClickpeakExcursion = "RightMarkerSearchMenuClickpeakExcursion";
        /// <summary>
        /// 右侧峰值点击峰值漂移值(多)
        /// </summary>
        public const string RightMarkerSearchMenuClickpeakMultiExcursion = "RightMarkerSearchMenuClickpeakMultiExcursion";
        /// <summary>
        ///标记搜索 目标
        /// </summary>
        public const string RightMarkerMarkerSearchTarget = "RightMarkerMarkerSearchTarget";
        /// <summary>
        ///标记搜索 多目标
        /// </summary>
        public const string RightMarkerMarkerSearchMultiTarget = "RightMarkerMarkerSearchMultiTarget";
        /// <summary>
        /// 右侧目标点击目标值
        /// </summary>
        public const string RightMarkerSearchMenuClickTargetValue = "RightMarkerSearchMenuClickTargetValue";
        /// <summary>
        /// 右侧多目标点击目标转移
        /// </summary>
        public const string RightMultiTargetMenuClickTargetValue = "RightMultiTargetMenuClickTargetValue";
        /// <summary>
        /// 右侧标记搜索击带宽值
        /// </summary>
        public const string RightMarkerSearchMenuClickBandwidthValue = "RightMarkerSearchMenuClickBandwidthValue";
        /// <summary>
        /// 右侧标记搜索击陷波值
        /// </summary>
        public const string RightMarkerSearchMenuClickNotchValue = "RightMarkerSearchMenuClickNotchValue";
        /// <summary>
        ///标记搜索 搜索范围
        /// </summary>
        public const string RightMarkerMarkerSearchSearchRange = "RightMarkerMarkerSearchSearchRange";
        /// <summary>
        ///标记搜索 搜索范围 多范围
        /// </summary>
        public const string RightMarkerMarkerSearchMultipleRange = "RightMarkerMarkerSearchMultipleRange";
        /// <summary>
        ///标记搜索 目标范围
        /// </summary>
        public const string RightMarkerMarkerSearchTargetRange = "RightMarkerMarkerSearchTargetRange";
        /// <summary>
        /// 右侧标记搜索 搜索范围单击开始值
        /// </summary>
        public const string RightSearchRangeMenuClickStartValue = "RightSearchRangeMenuClickStartValue";
        /// <summary>
        /// 右侧标记搜索 搜索范围单击结束值
        /// </summary>
        public const string RightSearchRangeMenuClickStopValue = "RightSearchRangeMenuClickStopValue";
        /// <summary>
        /// 右侧标记搜索 搜索范围-多范围单击开始值
        /// </summary>
        public const string RightSearchMultipleRangeMenuClickStartValue = "RightSearchMultipleRangeMenuClickStartValue";
        /// <summary>
        /// 右侧标记搜索 搜索范围-多范围单击结束值
        /// </summary>
        public const string RightSearchMultipleRangeMenuClickStopValue = "RightSearchMultipleRangeMenuClickStopValue";
        #endregion

        #region   标记功能消息事件定义
        /// <summary>
        /// 右侧标记功能 打开标记表
        /// </summary>
        public const string RightMarkerFunctionMenuOpenMarkerTable = "RightMarkerFunctionMenuOpenMarkerTable";
        /// <summary>
        /// 右侧标记功能 打开注释选项
        /// </summary>
        public const string RightMarkerFunctionMenuAnnotationOptions = "RightMarkerFunctionMenuAnnotationOptions";
        /// <summary>
        /// 右侧标记功能 点击显示位置
        /// </summary>
        public const string RightMarkerFunctionMenuClickMarkerInfoPos = "RightMarkerFunctionMenuClickMarkerInfoPos";
        #endregion

        #region   状态栏提示消息事件定义
        /// <summary>
        /// 通道状态栏提示
        /// </summary>
        public const string ChannelStatusPromptShowData = "ChannelStatusPromptShowData";
        /// <summary>
        /// 通道状态栏参考源
        /// </summary>
        public const string ChannelStatusRefSourceChange = "ChannelStatusRefSourceChange";
        /// <summary>
        /// 主通道状态栏字体大小改变
        /// </summary>
        public const string MainChannelStatusChangeFontSize = "MainChannelStatusChangeFontSize";
        /// <summary>
        /// 通道状态栏字体大小改变
        /// </summary>
        public const string ChannelStatusChangeFontSize = "ChannelStatusChangeFontSize";
        /// <summary>
        /// 通道状态栏警告提示
        /// </summary>
        public const string ChannelStatusWarningShowData = "ChannelStatusWarningShowData";
        /// <summary>
        /// 通道状态栏更新关闭提示
        /// </summary>
        public const string ChannelStatusUpdateOffShowData = "ChannelStatusUpdateOffShowData";

        /// <summary>
        /// 是否显示时间
        /// </summary>
        public const string TimeStatusChange = "TimeStatusChange";


        /// <summary>
        /// 是否RF out
        /// </summary>
        public const string RFOUTChange = "RFOUTChange";


        /// <summary>
        /// 虚拟键盘事件
        /// </summary>
        public const string VisualKeysEvent = "VisualKeysEvent";
        #endregion

        #region   格式消息事件定义
        /// <summary>
        /// 格式-史密斯
        /// </summary>
        public const string RightFormatSmith = "RightFormatSmith";
        /// <summary>
        /// 格式-极坐标
        /// </summary>
        public const string RightFormatPolar = "RightFormatPolar";
        #endregion

        #region   分析消息事件定义
        /// <summary>
        /// 分析-极限测试
        /// </summary>
        public const string RightAnalysisLimitTest = "RightAnalysisLimitTest";
        /// <summary>
        /// 分析-极限测试-编辑极限线
        /// </summary>
        public const string RightAnalysisLimitEditLimitLine = "RightAnalysisLimitEditLimitLine";
        /// <summary>
        /// 分析-极限测试-极限线偏移
        /// </summary>
        public const string RightAnalysisLimitLineOffsets = "RightAnalysisLimitLineOffsets";
        /// <summary>
        /// 分析-纹波测试
        /// </summary>
        public const string RightAnalysisRippleLimit = "RightAnalysisRippleLimit";
        /// <summary>
        /// 分析-纹波测试值
        /// </summary>
        public const string RightAnalysisRippleLimitValue = "RightAnalysisRippleLimitValue";
        /// <summary>
        /// 分析-纹波值频带
        /// </summary>
        public const string RightAnalysisRippleLimitBand = "RightAnalysisRippleLimitBand";
        /// <summary>
        /// 分析-纹波极限测试-编辑纹波极限
        /// </summary>
        public const string RightAnalysisEditRippleLimit = "RightAnalysisEditRippleLimit";
        /// <summary>
        /// 分析-带宽测试
        /// </summary>
        public const string RightAnalysisBandwidthLimit = "RightAnalysisBandwidthLimit";
        /// <summary>
        /// 分析-带宽测试-带宽阈值
        /// </summary>
        public const string RightAnalysisBandwidthLimitNdBPoints = "RightAnalysisBandwidthLimitNdBPoints";
        /// <summary>
        /// 分析-带宽测试-最小带宽
        /// </summary>
        public const string RightAnalysisBandwidthLimitMinBandwidth = "RightAnalysisBandwidthLimitMinBandwidth";
        /// <summary>
        /// 分析-带宽测试-最大带宽
        /// </summary>
        public const string RightAnalysisBandwidthLimitMaxBandwidth = "RightAnalysisBandwidthLimitMaxBandwidth";
        /// <summary>
        /// 分析-点极限测试
        /// </summary>
        public const string RightAnalysisPointLimitTest = "RightAnalysisPointLimitTest";
        /// <summary>
        /// 分析-点极限测试-编辑点极限
        /// </summary>
        public const string RightAnalysisEditPointLimit = "RightAnalysisEditPointLimit";
        /// <summary>
        /// 分析-转换
        /// </summary>
        public const string RightAnalysisConversion = "RightAnalysisConversion";
        /// <summary>
        /// 分析-时域选通
        /// </summary>
        public const string RightAnalysisGating = "RightAnalysisGating";
        /// <summary>
        /// 分析-时域选通-形状
        /// </summary>
        public const string RightAnalysisGatingShape = "RightAnalysisGatingShape";
        /// <summary>
        /// 分析-时域转换
        /// </summary>
        public const string RightAnalysisTransform = "RightAnalysisTransform";
        /// <summary>
        /// 分析-时域转换-类型
        /// </summary>
        public const string RightAnalysisTransformType = "RightAnalysisTransformType";
        /// <summary>
        /// 分析-时域转换-窗口
        /// </summary>
        public const string RightAnalysisTransformWindow = "RightAnalysisTransformWindow";
        /// <summary>
        /// 分析-转换-功能
        /// </summary>
        public const string RightAnalysisConversionFunction = "RightAnalysisConversionFunction";
        /// <summary>
        /// 分析-夹具仿真器
        /// </summary>
        public const string RightAnalysisFixtureSimulator = "RightAnalysisFixtureSimulator";
        /// <summary>
        /// 分析-夹具仿真器-端口 Z 转换
        /// </summary>
        public const string RightAnalysisFixturePortZConversion = "RightAnalysisFixturePortZConversion";
        /// <summary>
        /// 分析-夹具仿真器-差动匹配
        /// </summary>
        public const string RightAnalysisFixtureDiffMatching = "RightAnalysisFixtureDiffMatching";
        /// <summary>
        /// 分析-夹具仿真器-差动Z转换
        /// </summary>
        public const string RightAnalysisFixtureDiffZConversion = "RightAnalysisFixtureDiffZConversion";
        /// <summary>
        /// 分析-夹具仿真器-差动匹配-选择电路
        /// </summary>
        public const string RightAnalysisFixtureDifMatSelectCircuit = "RightAnalysisFixtureDifMatSelectCircuit";
        /// <summary>
        /// 分析-夹具仿真器-差动匹配-选择端口
        /// </summary>
        public const string RightAnalysisFixtureDifMatSelectPort = "RightAnalysisFixtureDifMatSelectPort";
        /// <summary>
        /// 分析-夹具仿真器-布局
        /// </summary>
        public const string RightAnalysisFixtureBalunTopology = "RightAnalysisFixtureBalunTopology";
        /// <summary>
        /// 分析-夹具仿真器-布局-device
        /// </summary>
        public const string FixtureBalunTopologyDevice = "FixtureBalunTopologyDevice";
        /// <summary>
        /// 分析-夹具仿真器-布局-端口1
        /// </summary>
        public const string FixtureBalunTopologySinglePort = "FixtureBalunTopologySinglePort";
        /// <summary>
        /// 分析-夹具仿真器-布局-端口2
        /// </summary>
        public const string FixtureBalunTopologyTwoPort = "FixtureBalunTopologyTwoPort";
        /// <summary>
        /// 分析-夹具仿真器-端口匹配
        /// </summary>
        public const string RightAnalysisFixturePortMatching = "RightAnalysisFixturePortMatching";
        /// <summary>
        /// 分析-夹具仿真器-去嵌入
        /// </summary>
        public const string RightAnalysisFixtureDeEmbedding = "RightAnalysisFixtureDeEmbedding";
        /// <summary>
        /// 端口匹配参数
        /// </summary>
        public const string RightFixturePortMatchingClickPortMatchingPar = "RightFixturePortMatchingClickPortMatchingPar";
        /// <summary>
        /// 分析-夹具仿真器-端口匹配--选择端口
        /// </summary>
        public const string RightPortMatchingSelectPort = "RightPortMatchingSelectPort";
        /// <summary>
        /// 分析-夹具仿真器-端口匹配--选择电路
        /// </summary>
        public const string RightPortMatchingSelectCircuit = "RightPortMatchingSelectCircuit";
        /// <summary>
        /// 差分Z转换参数
        /// </summary>
        public const string RightFixturePortZConversionClickgParameter = "RightFixturePortZConversionClickgParameter";
        /// <summary>
        /// TDR-凯塞系数
        /// </summary>
        public const string TDRKaiserBeta = "TDRKaiserBeta";
        #endregion

        #region 虚拟键消息定义
        public const string VisualKeysActiveChannelTrace = "VisualKeysActiveChannelTrace";
        public const string VisualKeysChannelNext = "VisualKeysChannelNext";
        public const string VisualKeysChannelPrev = "VisualKeysChannelPrev";
        public const string VisualKeysTracePrev = "VisualKeysTracePrev";
        public const string VisualKeysTraceNext = "VisualKeysTraceNext";

        public const string VisualKeysResponse = "VisualKeysResponse";
        public const string VisualKeysChannelMax = "VisualKeysChannelMax";
        public const string VisualKeysTraceMax = "VisualKeysTraceMax";
        public const string VisualKeysMeasurement = "VisualKeysMeasurement";
        public const string VisualKeysFormat = "VisualKeysFormat";
        public const string VisualKeysScale = "VisualKeysScale";
        public const string VisualKeysDisplay = "VisualKeysDisplay";
        public const string VisualKeysAverage = "VisualKeysAverage";
        public const string VisualKeysCalibration = "VisualKeysCalibration";

        public const string VisualKeysStimulus = "VisualKeysStimulus";
        public const string VisualKeysStart = "VisualKeysStart";
        public const string VisualKeysStop = "VisualKeysStop";
        public const string VisualKeysCenter = "VisualKeysCenter";
        public const string VisualKeysSpan = "VisualKeysSpan";
        public const string VisualKeysSweepSetup = "VisualKeysSweepSetup";
        public const string VisualKeysTrigger = "VisualKeysTrigger";

        public const string VisualKeysMkrAnalysis = "VisualKeysMkrAnalysis";
        public const string VisualKeysMarker = "VisualKeysMarker";
        public const string VisualKeysMarkerSearch = "VisualKeysMarkerSearch";
        public const string VisualKeysMarkerFunc = "VisualKeysMarkerFunc";
        public const string VisualKeysAnalysis = "VisualKeysAnalysis";

        public const string VisualKeysInstrState = "VisualKeysInstrState";
        public const string VisualKeysStateOne = "VisualKeysStateOne";
        public const string VisualKeysStateTwo = "VisualKeysStateTwo";
        public const string VisualKeysStateThree = "VisualKeysStateThree";
        public const string VisualKeysSaveRecall = "VisualKeysSaveRecall";
        public const string VisualKeysSystem = "VisualKeysSystem";
        public const string VisualKeysPreset = "VisualKeysPreset";

        public const string VisualKeysEntry = "VisualKeysEntry";
        public const string VisualKeysGN = "VisualKeysGN";
        public const string VisualKeysMU = "VisualKeysMU";
        public const string VisualKeysKM = "VisualKeysKM";
        public const string VisualKeysAddDel = "VisualKeysAddDel";
        public const string VisualKeysHelp = "VisualKeysHelp";
        public const string VisualKeysFocus = "VisualKeysFocus";
        public const string VisualKeysEnterOff = "VisualKeysEnterOff";

        public const string VisualKeysNavigation = "VisualKeysNavigation";
        public const string VisualKeysRevolveUpDown = "VisualKeysRevolveUpDown";
        public const string VisualKeysEnter = "VisualKeysEnter";
        public const string VisualKeysPageUp = "VisualKeysPageUp";
        public const string VisualKeysPageDown = "VisualKeysPageDown";
        public const string VisualKeysUp = "VisualKeysUp";
        public const string VisualKeysDown = "VisualKeysDown";
        public const string VisualKeysHome = "VisualKeysHome";
        public const string VisualKeysEnd = "VisualKeysEnd";
        public const string VisualKeysLeft = "VisualKeysLeft";
        public const string VisualKeysRight = "VisualKeysRight";
        public const string VisualKeysF1 = "VisualKeysF1";
        //public const string VisualKeysHome = "VisualKeysHome";
        //public const string VisualKeysEnd = "VisualKeysEnd";

        #endregion
        #endregion

        #region 分析相关
        #region 去嵌入
        /// <summary>
        /// 选择端口
        /// </summary>
        public static int SelectPort = 1;
        #endregion

        #endregion
    }

    public class CommonFunction
    {
        public static string GetShowDataRepairPosition(decimal value, int position = 6,
     int roundNum = 3, string unitStr = CommonData.Hz, bool isCutLen = true, bool isMathRound = false)
        {
            int newPosition = 0;
            string result = "";
            string tailStr = "";
            bool flag = false;
            decimal data = value;

            //if (unitStr == "Hz")
            //{
            //    data = Math.Round(data, 0);
            //}

            if (data < 0)
            {
                flag = true;
                data = -data;
            }

            if (data / (decimal)CommonData.UnitE >= 1)
            {
                if (isMathRound)
                {
                    data = data / (decimal)CommonData.UnitE;

                    if (data.ToString().Contains("."))
                    {
                        newPosition = position - data.ToString().Substring(0, data.ToString().LastIndexOf(".")).Length - 1;
                    }
                    else
                    {
                        newPosition = position - data.ToString().Length - 1;
                    }

                    result = (Math.Round(data, newPosition, MidpointRounding.AwayFromZero)).ToString();
                }
                else
                {
                    result = (data / (decimal)CommonData.UnitE).ToString();
                }

                tailStr = " " + CommonData.E;
            }
            else if (data / (decimal)CommonData.UnitP >= 1)
            {
                if (isMathRound)
                {
                    data = data / (decimal)CommonData.UnitP;

                    if (data.ToString().Contains("."))
                    {
                        newPosition = position - data.ToString().Substring(0, data.ToString().LastIndexOf(".")).Length - 1;
                    }
                    else
                    {
                        newPosition = position - data.ToString().Length - 1;
                    }

                    result = (Math.Round(data, newPosition, MidpointRounding.AwayFromZero)).ToString();
                }
                else
                {
                    result = (data / (decimal)CommonData.UnitP).ToString();
                }

                tailStr = " " + CommonData.P;
            }
            else if (data / (decimal)CommonData.UnitT >= 1)
            {
                if (isMathRound)
                {
                    data = data / (decimal)CommonData.UnitT;

                    if (data.ToString().Contains("."))
                    {
                        newPosition = position - data.ToString().Substring(0, data.ToString().LastIndexOf(".")).Length - 1;
                    }
                    else
                    {
                        newPosition = position - data.ToString().Length - 1;
                    }

                    result = (Math.Round(data, newPosition, MidpointRounding.AwayFromZero)).ToString();
                }
                else
                {
                    result = (data / (decimal)CommonData.UnitT).ToString();
                }

                tailStr = " " + CommonData.T;
            }
            else if (data / (decimal)CommonData.UnitG >= 1)
            {
                if (isMathRound)
                {
                    data = data / (decimal)CommonData.UnitG;

                    if (data.ToString().Contains("."))
                    {
                        newPosition = position - data.ToString().Substring(0, data.ToString().LastIndexOf(".")).Length - 1;
                    }
                    else
                    {
                        newPosition = position - data.ToString().Length - 1;
                    }

                    result = (Math.Round(data, newPosition, MidpointRounding.AwayFromZero)).ToString();
                }
                else
                {
                    result = (data / (decimal)CommonData.UnitG).ToString();
                }

                tailStr = " " + CommonData.G;
            }
            else if (data / (decimal)CommonData.UnitM >= 1)
            {
                if (isMathRound)
                {
                    data = data / (decimal)CommonData.UnitM;

                    if (data.ToString().Contains("."))
                    {
                        newPosition = position - data.ToString().Substring(0, data.ToString().LastIndexOf(".")).Length - 1;
                    }
                    else
                    {
                        newPosition = position - data.ToString().Length - 1;
                    }

                    result = (Math.Round(data, newPosition, MidpointRounding.AwayFromZero)).ToString();
                }
                else
                {
                    result = (data / (decimal)CommonData.UnitM).ToString();
                }

                tailStr = " " + CommonData.M;
            }
            else if (data / (decimal)CommonData.Unitk >= 1)
            {
                if (isMathRound)
                {
                    data = data / (decimal)CommonData.Unitk;

                    if (data.ToString().Contains("."))
                    {
                        newPosition = position - data.ToString().Substring(0, data.ToString().LastIndexOf(".")).Length - 1;
                    }
                    else
                    {
                        newPosition = position - data.ToString().Length - 1;
                    }

                    result = (Math.Round(data, newPosition, MidpointRounding.AwayFromZero)).ToString();
                }
                else
                {
                    result = (data / (decimal)CommonData.Unitk).ToString();
                }

                tailStr = " " + CommonData.k;
            }
            else if (data * (decimal)CommonData.Unitk >= 1 && data * (decimal)CommonData.Unitk < (decimal)CommonData.Unitk)
            {
                if (isMathRound)
                {
                    data = data * (decimal)CommonData.Unitk;

                    if (data.ToString().Contains("."))
                    {
                        newPosition = position - data.ToString().Substring(0, data.ToString().LastIndexOf(".")).Length - 1;
                    }
                    else
                    {
                        newPosition = position - data.ToString().Length - 1;
                    }

                    result = (Math.Round(data, newPosition, MidpointRounding.AwayFromZero)).ToString();
                }
                else
                {
                    result = (data * (decimal)CommonData.Unitk).ToString();
                }

                tailStr = " " + CommonData.m;
            }
            else if (data * (decimal)CommonData.UnitM >= 1 && data * (decimal)CommonData.UnitM < (decimal)CommonData.UnitM)
            {
                if (isMathRound)
                {
                    data = data * (decimal)CommonData.UnitM;
                    newPosition = data.ToString().Contains(".") ?
                        position - data.ToString().Substring(0, data.ToString().LastIndexOf(".")).Length - 1 :
                        position - data.ToString().Length - 1;

                    result = (Math.Round(data, newPosition, MidpointRounding.AwayFromZero)).ToString();
                }
                else
                {
                    result = (data * (decimal)CommonData.UnitM).ToString();
                }

                tailStr = " " + CommonData.u;
            }
            else if (data * (decimal)CommonData.UnitG >= 1 && data * (decimal)CommonData.UnitG < (decimal)CommonData.UnitG)
            {
                if (isMathRound)
                {
                    data = data * (decimal)CommonData.UnitG;
                    newPosition = data.ToString().Contains(".") ?
                        position - data.ToString().Substring(0, data.ToString().LastIndexOf(".")).Length - 1 :
                        position - data.ToString().Length - 1;
                    result = (Math.Round(data, newPosition, MidpointRounding.AwayFromZero)).ToString();
                }
                else
                {
                    result = (data * (decimal)CommonData.UnitG).ToString();
                }

                tailStr = " " + CommonData.n;
            }
            else if (data * (decimal)CommonData.UnitT >= 1 && data * (decimal)CommonData.UnitT < (decimal)CommonData.UnitT)
            {
                if (isMathRound)
                {
                    data = data * (decimal)CommonData.UnitT;
                    newPosition = data.ToString().Contains(".") ?
                        position - data.ToString().Substring(0, data.ToString().LastIndexOf(".")).Length - 1 :
                        position - data.ToString().Length - 1;
                    result = (Math.Round(data, newPosition, MidpointRounding.AwayFromZero)).ToString();
                }
                else
                {
                    result = (data * (decimal)CommonData.UnitT).ToString();
                }

                tailStr = " " + CommonData.p;
            }
            else if (data * (decimal)CommonData.UnitP >= 1 && data * (decimal)CommonData.UnitP < (decimal)CommonData.UnitP)
            {
                if (isMathRound)
                {
                    data = data * (decimal)CommonData.UnitP;
                    newPosition = data.ToString().Contains(".") ?
                        position - data.ToString().Substring(0, data.ToString().LastIndexOf(".")).Length - 1 :
                        position - data.ToString().Length - 1;
                    result = (Math.Round(data, newPosition, MidpointRounding.AwayFromZero)).ToString();
                }
                else
                {
                    result = (data * (decimal)CommonData.UnitP).ToString();
                }

                tailStr = " " + CommonData.f;
            }
            else if (data * (decimal)CommonData.UnitE >= 1 && data * (decimal)CommonData.UnitE < (decimal)CommonData.UnitE)
            {
                if (isMathRound)
                {
                    data = data * (decimal)CommonData.UnitE;
                    newPosition = data.ToString().Contains(".") ?
                        position - data.ToString().Substring(0, data.ToString().LastIndexOf(".")).Length - 1 :
                        position - data.ToString().Length - 1;
                    result = (Math.Round(data, newPosition, MidpointRounding.AwayFromZero)).ToString();
                }
                else
                {
                    result = (data * (decimal)CommonData.UnitE).ToString();
                }

                tailStr = " " + CommonData.a;
            }
            else
            {
                if (isMathRound)
                {
                    newPosition = data.ToString().Contains(".") ?
                        position - data.ToString().Substring(0, data.ToString().LastIndexOf(".")).Length - 1 :
                        position - data.ToString().Length - 1;
                    result = (Math.Round(data, newPosition, MidpointRounding.AwayFromZero)).ToString();
                }
                else
                {
                    result = data.ToString();
                }

                tailStr = " ";
            }

            // result = Math.Round(decimal.Parse(result), roundNum, MidpointRounding.AwayFromZero).ToString();

            if (isCutLen)
            {
                if (result.Length < position)
                {
                    int max = position - result.Length;

                    for (int i = 0; i < max; ++i)
                    {
                        if (result.Contains("."))
                        {
                            result += "0";
                        }
                        else
                        {
                            if ((position - result.Length) > 1)
                                result += ".";
                        }
                    }
                }

                if (result.Length > position)
                {
                    result = result.Substring(0, position);
                }
            }

            if (flag)
            {
                result = "-" + result;
            }
            /* else if (result.Length > position && result.Contains("."))//4舍5入
             {
                 int integerNum = result.Substring(0, result.IndexOf(".")).Length;
                 result = Math.Round(double.Parse(result), position - integerNum - 1, MidpointRounding.AwayFromZero).ToString();
             }*/
            if (unitStr != "")
            {
                result += tailStr + unitStr;
            }
            else if (tailStr != "" && tailStr != " ")
            {
                result += tailStr;
            }

            return result;
        }
    }
}
